Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 5 | <script> |
michael@0 | 6 | function doIs(arg1, arg2, arg3) { |
michael@0 | 7 | window.parent.postMessage("t " + encodeURIComponent(arg1) + " " + |
michael@0 | 8 | encodeURIComponent(arg2) + " " + |
michael@0 | 9 | encodeURIComponent(arg3), "*"); |
michael@0 | 10 | } |
michael@0 | 11 | |
michael@0 | 12 | function $(arg) { return document.getElementById(arg); } |
michael@0 | 13 | |
michael@0 | 14 | window.addEventListener("message", |
michael@0 | 15 | function(evt) { |
michael@0 | 16 | var t = $("target"); |
michael@0 | 17 | if (evt.data == "start") { |
michael@0 | 18 | doIs(t.value, "Test", "Shouldn't have lost our initial value"); |
michael@0 | 19 | t.focus(); |
michael@0 | 20 | sendString("Foo"); |
michael@0 | 21 | doIs(t.value, "FooTest", "Typing should work"); |
michael@0 | 22 | window.parent.postMessage("c", "*"); |
michael@0 | 23 | } else { |
michael@0 | 24 | doIs(evt.data, "continue", "Unexpected message"); |
michael@0 | 25 | doIs(t.value, "FooTest", "Shouldn't have lost our typed value"); |
michael@0 | 26 | sendString("Bar"); |
michael@0 | 27 | doIs(t.value, "BarFooTest", "Typing should still work"); |
michael@0 | 28 | window.parent.postMessage("f", "*"); |
michael@0 | 29 | } |
michael@0 | 30 | }, |
michael@0 | 31 | "false"); |
michael@0 | 32 | |
michael@0 | 33 | </script> |
michael@0 | 34 | </head> |
michael@0 | 35 | <body> |
michael@0 | 36 | <input id="target" value="Test"> |
michael@0 | 37 | </body> |
michael@0 | 38 | </html> |
michael@0 | 39 |