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 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
michael@0 | 4 | type="text/css"?> |
michael@0 | 5 | <!-- |
michael@0 | 6 | https://bugzilla.mozilla.org/show_bug.cgi?id=616841 |
michael@0 | 7 | --> |
michael@0 | 8 | <window title="Mozilla Bug 616841" |
michael@0 | 9 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 10 | onload="start()"> |
michael@0 | 11 | <label value="Mozilla Bug 616841"/> |
michael@0 | 12 | <!-- test code goes here --> |
michael@0 | 13 | <script type="application/javascript"><![CDATA[ |
michael@0 | 14 | |
michael@0 | 15 | const FRAME_SCRIPT = |
michael@0 | 16 | "data:,addMessageListener(\n"+ |
michael@0 | 17 | " 'cmp',\n"+ |
michael@0 | 18 | " function (m) {\n"+ |
michael@0 | 19 | " sendAsyncMessage('cmp', { i: m.json.i,\n"+ |
michael@0 | 20 | " cmp: m.json.a.localeCompare(m.json.b) });\n"+ |
michael@0 | 21 | " });\n"+ |
michael@0 | 22 | "sendAsyncMessage('contentReady');"; |
michael@0 | 23 | |
michael@0 | 24 | var toCompare = [ [ "C", "D" ], |
michael@0 | 25 | [ "D", "C" ], |
michael@0 | 26 | [ "\u010C", "D" ], |
michael@0 | 27 | [ "D", "\u010C" ] ]; |
michael@0 | 28 | var nCmps = 0; |
michael@0 | 29 | |
michael@0 | 30 | function recvContentReady(m) { |
michael@0 | 31 | for (var i = 0; i < toCompare.length; ++i) { |
michael@0 | 32 | var pair = toCompare[i]; |
michael@0 | 33 | messageManager.broadcastAsyncMessage("cmp", |
michael@0 | 34 | { i: i, a: pair[0], b: pair[1] }); |
michael@0 | 35 | } |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | function recvCmp(m) { |
michael@0 | 39 | var i = m.json.i, cmp = m.json.cmp; |
michael@0 | 40 | var pair = toCompare[i]; |
michael@0 | 41 | opener.wrappedJSObject.is(pair[0].localeCompare(pair[1]), cmp, "localeCompare returned same result in frame script"); |
michael@0 | 42 | |
michael@0 | 43 | if (toCompare.length == ++nCmps) { |
michael@0 | 44 | messageManager.removeMessageListener("cmp", recvCmp); |
michael@0 | 45 | finish(); |
michael@0 | 46 | } |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | function start() { |
michael@0 | 50 | messageManager.addMessageListener("contentReady", recvContentReady); |
michael@0 | 51 | messageManager.addMessageListener("cmp", recvCmp); |
michael@0 | 52 | messageManager.loadFrameScript(FRAME_SCRIPT, true); |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | function finish() { |
michael@0 | 56 | opener.setTimeout("done()", 0); |
michael@0 | 57 | window.close(); |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | ]]></script> |
michael@0 | 61 | |
michael@0 | 62 | <browser id="browser" type="content" src="about:blank"/> |
michael@0 | 63 | </window> |