Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: LayoutTests/fast/dom/Orientation/script-tests/create-event-orientationchange.js

Issue 137143002: Remove compile time flag ORIENTATION_EVENT and use runtime flag instead. Update layout test case to… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/Orientation/script-tests/create-event-orientationchange.js
diff --git a/LayoutTests/fast/dom/Orientation/script-tests/create-event-orientationchange.js b/LayoutTests/fast/dom/Orientation/script-tests/create-event-orientationchange.js
index 9015bb53ba609d280563fdf11545cf681ca94977..59b356ae7e8635b7d288607bd3cb18d78b7d991c 100644
--- a/LayoutTests/fast/dom/Orientation/script-tests/create-event-orientationchange.js
+++ b/LayoutTests/fast/dom/Orientation/script-tests/create-event-orientationchange.js
@@ -1,16 +1,20 @@
-description('Tests that document.createEvent() works with orientationChange')
+description('Tests that document.createEvent() works with orientationChange if enabled')
-function handleOrientationChange()
+function handleTestResult()
{
document.getElementById('result').innerHTML = "PASS";
}
-window.addEventListener('orientationchange', handleOrientationChange, false);
+if (window.internals && internals.runtimeFlags.orientationEventEnabled) {
+ window.addEventListener('orientationchange', handleTestResult, false);
-try {
- var event = document.createEvent("OrientationEvent");
- event.initEvent("orientationchange", false, false);
- window.dispatchEvent(event);
-} catch(e) {
- document.getElementById('result').innerHTML = "FAIL... orientationChange event doesn't appear to be enabled or implemented.";
+ try {
+ var event = document.createEvent("OrientationEvent");
+ event.initEvent("orientationchange", false, false);
+ window.dispatchEvent(event);
+ } catch(e) {
+ document.getElementById('result').innerHTML = "FAIL... orientationChange event doesn't appear to be enabled or implemented.";
+ }
+} else {
+ handleTestResult();
}
« no previous file with comments | « LayoutTests/fast/dom/Orientation/create-event-orientationchange-expected.txt ('k') | Source/build/features.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698