Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=634834 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 634834</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=634834">Mozilla Bug 634834</a> |
michael@0 | 14 | |
michael@0 | 15 | <script type='application/javascript;version=1.7'> |
michael@0 | 16 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 17 | |
michael@0 | 18 | function iframe_loaded() { |
michael@0 | 19 | var loadedAfterPushstate = false; |
michael@0 | 20 | $('iframe').onload = function() { |
michael@0 | 21 | loadedAfterPushstate = true; |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | var obj = { name: 'name' }; |
michael@0 | 25 | obj.__defineGetter__('a', function() { |
michael@0 | 26 | $('iframe').contentWindow.location = 'http://example.com'; |
michael@0 | 27 | |
michael@0 | 28 | // Wait until we've loaded example.com. |
michael@0 | 29 | do { |
michael@0 | 30 | var r = new XMLHttpRequest(); |
michael@0 | 31 | r.open("GET", location.href, false); |
michael@0 | 32 | r.overrideMimeType("text/plain"); |
michael@0 | 33 | try { r.send(null); } |
michael@0 | 34 | catch (e) {} |
michael@0 | 35 | } while (!loadedAfterPushstate); |
michael@0 | 36 | }); |
michael@0 | 37 | |
michael@0 | 38 | try { |
michael@0 | 39 | $('iframe').contentWindow.history.pushState(obj, ''); |
michael@0 | 40 | ok(false, 'pushState should throw exception.'); |
michael@0 | 41 | } |
michael@0 | 42 | catch(e) { |
michael@0 | 43 | ok(true, 'pushState threw an exception.'); |
michael@0 | 44 | } |
michael@0 | 45 | SimpleTest.finish(); |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | </script> |
michael@0 | 49 | |
michael@0 | 50 | <iframe id='iframe' src='file_bug634834.html' onload='iframe_loaded()'></iframe> |
michael@0 | 51 | |
michael@0 | 52 | </body> |
michael@0 | 53 | </html> |