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

Side by Side Diff: LayoutTests/plugins/netscape-plugin-page-cache-works.html

Issue 14495004: Remove left-over PageCache stuff (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <script>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
6 testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
7 testRunner.overridePreference("WebKitPageCacheSupportsPluginsPreferenceKey", 1);
8 }
9
10 var savedTestObject = null;
11 var currentTestStage = null;
12 var hasHidden = false;
13
14 function runTest()
15 {
16 var plugin = document.getElementById("testPlugin");
17
18 if (!savedTestObject)
19 savedTestObject = plugin.testObject;
20
21 try {
22 log("Accessing testObject.property");
23 savedTestObject.property;
24 log("Accessed testObject.property without exception");
25 } catch (e) {
26 log("While accessing testObject.property: " + e);
27 }
28
29 try {
30 log("Assigning to testObject.property");
31 savedTestObject.property = 'hello';
32 log("Assigned to testObject.property without exception");
33 } catch (e) {
34 log("While assigning to testObject.property: " + e);
35 }
36
37 if (!hasHidden)
38 setTimeout("window.location.href = 'resources/go-back.html'", 0);
39 else {
40 if (window.testRunner)
41 testRunner.notifyDone();
42 }
43
44 }
45
46 function loaded() {
47 currentTestStage = "Initial load";
48 log("Page loaded");
49 }
50
51 function hidden() {
52 log("Page hidden");
53 hasHidden = true;
54 }
55
56 function shown() {
57 if (hasHidden)
58 currentTestStage = "Restored from page cache"
59 log("Page shown");
60 }
61
62 function pluginCreated()
63 {
64 log("Plugin created");
65 setTimeout("runTest()", 0);
66 }
67
68 function log(message)
69 {
70 document.getElementById("logging").innerHTML += currentTestStage + ": " + mes sage + "<br>";
71 }
72 </script>
73
74 <body onload="loaded()" onpagehide="hidden();" onpageshow="shown();">
75 This tests that pages with plugins behave properly with the page cache. This in cludes:<br>
76 -The plugin being destroyed upon navigation away from the page.<br>
77 -The plugin being recreated upon restoring the page from the page cache.<br>
78 -Plugin script objects accessed the first time the plugin was created are approp riately invalidated after the page has been restored from the page cache.<br><br >
79 Unfortunately there is no reliable way to get affirmative confirmation that the plugin was destroyed upon navigation away from the page. For now we'll assume r ecreation means it had successfully been destroyed.<br>
80 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" hei ght="200" onNew="pluginCreated()"></embed><br>
81 <div id="logging"></div>
82 </body>
83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698