Index: LayoutTests/screen_orientation/page-visibility.html |
diff --git a/LayoutTests/screen_orientation/page-visibility.html b/LayoutTests/screen_orientation/page-visibility.html |
index 8a1517d6ba6be0f22291009cc1a90b9c91eae176..f9bdff9572f251ab0c47cc0937f2f2a8ec590fe9 100644 |
--- a/LayoutTests/screen_orientation/page-visibility.html |
+++ b/LayoutTests/screen_orientation/page-visibility.html |
@@ -8,11 +8,11 @@ |
var orientationChangeEventListenerCalls = 0; |
var orientationChangeEventListenerCallsForFrame = 0; |
-window.addEventListener('orientationchange', function() { |
+screen.orientation.addEventListener('change', function() { |
orientationChangeEventListenerCalls++; |
}); |
-window.frames[0].addEventListener('orientationchange', function() { |
+window.frames[0].screen.orientation.addEventListener('change', function() { |
orientationChangeEventListenerCallsForFrame++; |
}); |
@@ -21,8 +21,8 @@ test(function() { |
if (window.testRunner) |
window.testRunner.setMockScreenOrientation("landscape-primary"); |
assert_equals(orientationChangeEventListenerCalls, 1); |
- assert_equals(screen.orientation, "landscape-primary"); |
-}, "Test that 'orientationchange' event is fired when the page is visible"); |
+ assert_equals(screen.orientation.type, "landscape-primary"); |
+}, "Test that a change event is fired when the page is visible"); |
if (window.testRunner) |
testRunner.setPageVisibility("hidden"); |
@@ -32,10 +32,10 @@ test(function() { |
if (window.testRunner) |
window.testRunner.setMockScreenOrientation("portrait-primary"); |
assert_equals(orientationChangeEventListenerCalls, 1); |
-}, "Test that 'orientationchange' event is not fired when the page is not visible"); |
+}, "Test that change event is not fired when the page is not visible"); |
test(function() { |
- assert_equals(screen.orientation, "landscape-primary"); |
+ assert_equals(screen.orientation.type, "landscape-primary"); |
}, "Test that screen.orientation keeps returning the same orientation when the page is not visible"); |
if (window.testRunner) |
@@ -43,10 +43,10 @@ if (window.testRunner) |
test(function() { |
assert_false(document.hidden); |
- // An 'orientationchange' event should have been fired. |
+ // A change event should have been fired. |
assert_equals(orientationChangeEventListenerCalls, 2); |
// Should keep returning the start returning the orientation value. |
- assert_equals(screen.orientation, "portrait-primary"); |
+ assert_equals(screen.orientation.type, "portrait-primary"); |
}, "Test that screen.orientation is updated once the page is visible again"); |
test(function() { |