Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / appcache / appcache-swap.html
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="appcache-test.js"></script>
5 <script src="../network-test.js"></script>
6 <script src="../resources-test.js"></script>
7 <script>
8 function test()
9 {
10     var frameId1;
11     var frameId2;
12
13     WebInspector.ResourcesPanel.show();
14     InspectorTest.startApplicationCacheStatusesRecording();
15     InspectorTest.dumpApplicationCache();
16     InspectorTest.createAndNavigateIFrame("resources/with-versioned-manifest.php", step1);
17
18     function step1(frameId)
19     {
20         frameId1 = frameId;
21         InspectorTest.waitForFrameManifestURLAndStatus(frameId1, "resources/versioned-manifest.php", applicationCache.IDLE, step2);
22     }
23
24     function step2()
25     {
26         InspectorTest.dumpApplicationCache();
27         InspectorTest.makeSimpleXHR("GET", "resources/versioned-manifest.php?command=step", true, step3);
28     }
29
30     function step3()
31     {
32         InspectorTest.createAndNavigateIFrame("resources/with-versioned-manifest.php", step4);
33     }
34
35     function step4(frameId)
36     {
37         frameId2 = frameId;
38         InspectorTest.waitForFrameManifestURLAndStatus(frameId1, "resources/versioned-manifest.php", applicationCache.UPDATEREADY, step5);
39     }
40
41     function step5(frameId)
42     {
43         InspectorTest.waitForFrameManifestURLAndStatus(frameId2, "resources/versioned-manifest.php", applicationCache.UPDATEREADY, step6);
44     }
45
46     function step6()
47     {
48         InspectorTest.dumpApplicationCache();
49
50         InspectorTest.swapFrameCache(frameId1);
51         InspectorTest.waitForFrameManifestURLAndStatus(frameId1, "resources/versioned-manifest.php", applicationCache.IDLE, step7);
52     }
53
54     function step7()
55     {
56         InspectorTest.dumpApplicationCache();
57         InspectorTest.completeTest();
58     }
59 }
60 </script>
61 </head>
62 <body onload="runTest()">
63 <p>Tests that application cache model keeps track of manifest urls and statuses correctly after UPDATEREADY event and swapCache() call.</p>
64 <a href="https://bugs.webkit.org/show_bug.cgi?id=72123">Bug 72123</a>
65 </body>
66 </html>