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

Side by Side Diff: LayoutTests/fast/loader/stateobjects/state-attribute-history-getter.html

Issue 40513003: Delete/move the remaining stale tests in TestExpectations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: delete plugins/reentrant-update-widget-positions.html as well Created 7 years, 1 month 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 <!DOCTYPE html>
2 <p>Check that setting a custom getter for history.state works correctly and that PopStateEvent.state still has a correct value.</p>
3 <pre id=log></pre>
4 <script>
5 function log(msg) {
6 document.querySelector("#log").innerHTML += msg + "<br>";
7 }
8
9 if (window.testRunner) {
10 testRunner.clearBackForwardList();
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
13 }
14
15 function test() {
16 if (!("state" in history)) {
17 log("FAIL: history.state is not defined");
18 return;
19 }
20
21 try {
22 Object.defineProperty(history, "state", { get: function () { return "oh hai" } });
23 } catch (e) {
24 // history.state is not configurable in JSC.
25 log(e.name == "TypeError" ? "PASS" : ("FAIL: unexpected exception: " + e ));
26 testRunner.notifyDone();
27 return;
28 }
29
30 if (history.state !== "oh hai") {
31 log('FAIL: history.state != "oh hai"');
32 }
33
34 history.pushState(42, "", "");
35 history.pushState(43, "", "");
36
37 window.onpopstate = function(e) {
38 if (e.state !== 42)
39 log("FAIL: e.state expected 42, was " + e.state + " (of type " + typ eof e.state + ")");
40 else
41 log("PASS");
42 if (window.testRunner)
43 testRunner.notifyDone();
44 }
45
46 history.back();
47 }
48
49 test();
50 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698