<!DOCTYPE html>
<html>
<body>
<script>

window.iframeLoaded = function() {
  document.location.hash = '#ready';

  var iframe = document.getElementsByTagName('iframe')[0];
  var oldScreen = iframe.contentWindow.screen;

  iframe.remove();

  oldScreen.orientation.unlock();
  document.location.hash = '#done';
}

</script>
<iframe src='detached-iframe.html'></iframe>
</body>
</html>

<!DOCTYPE html>
<html>
<body>
<script>

window.iframeLoaded = function() {
  document.location.hash = '#ready';

  var iframe = document.getElementsByTagName('iframe')[0];
  var oldScreen = iframe.contentWindow.screen;
  var oldOrient = oldScreen.orientation;

  iframe.remove();

  // The screen.orientation object will not be exposed once the
  // screen has become detached, but probe for it regardless to
  // verify that such post-detach use doesn't crash.
  oldOrient = oldScreen.orientation || oldOrient;

  oldOrient.unlock();
  document.location.hash = '#done';
}

</script>
<iframe src='detached-iframe.html'></iframe>
</body>
</html>

Adjust ScreenOrientation unit test to handle changed detachment timing.
Adjust ScreenOrientation unit test to handle changed detachment timing.

The observer notification of frame detachment is being changed via
http://crrev.com/881683003. Adjust a ScreenOrientationBrowserTest
test to also expect this new behavior.

R=mlamouri
BUG=446452

Review URL: https://codereview.chromium.org/909043002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#315564}
