1a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochdescription('Tests that pages that use DeviceOrientation are not put in the page cache.');
2a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch
3a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochif (window.layoutTestController) {
4a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    layoutTestController.waitUntilDone();
5a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    layoutTestController.setCanOpenWindows();
6a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    layoutTestController.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
7a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch} else
8a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    debug('This test can not be run without the LayoutTestController');
9a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch
10a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochvar pageOneOnloadCount = 0;
11a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochfunction reportPageOneOnload() {
12a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    ++pageOneOnloadCount;
13a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    debug('resources/cached-page-1.html onload fired, count = ' + pageOneOnloadCount);
14a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    if (pageOneOnloadCount == 2) {
15a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch        finishJSTest();
16a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    }
17a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch    return pageOneOnloadCount;
18a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch}
19a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch
20a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochdebug("Main page opening resources/cached-page-1.html");
21a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochwindow.open("resources/cached-page-1.html");
22a94275402997c11dd2e778633dacf4b7e630a35dBen Murdoch
23a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochwindow.jsTestIsAsync = true;
24a94275402997c11dd2e778633dacf4b7e630a35dBen Murdochwindow.successfullyParsed = true;
25