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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html

Issue 1160513003: W3C Test: Import web-platform-tests/html/browsers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase, bug links Created 5 years, 6 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 <!doctype html>
2 <meta charset=utf-8>
3 <title>Synthetic popstate events</title>
4 <script src="../../../../../../resources/testharness.js"></script>
5 <script src="../../../../../../resources/testharnessreport.js"></script>
6 <div id="log"></div>
7 <script>
8 test(function () {
9 assert_throws('NotSupportedError', function() {
10 document.createEvent('PopStateEvent');
11 }, 'document.createEvent("PopStateEvent") should not be supported');
12 }, 'document.createEvent');
13
14 test(function () {
15 assert_false('initPopStateEvent' in PopStateEvent.prototype,
16 'There should be no PopStateEvent#initPopStateEvent');
17 }, 'initPopStateEvent');
18
19 test(function () {
20 var state = history.state;
21 var data;
22 window.addEventListener('popstate', function (e) {
23 data = e.state;
24 });
25 window.dispatchEvent(new PopStateEvent('popstate', {
26 'state': {testdata:true}
27 }));
28 assert_true(data.testdata,'state data was corrupted');
29 assert_equals(history.state, state, "history.state was NOT set by dispatching the event");
30 }, 'Dispatching a synthetic PopStateEvent');
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698