|
1 <?xml version="1.0"?> |
|
2 |
|
3 <!-- This Source Code Form is subject to the terms of the Mozilla Public |
|
4 - License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> |
|
6 |
|
7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
8 |
|
9 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
10 width="600" |
|
11 height="600" |
|
12 onload="onLoad();" |
|
13 title="FindbarTest for bug 304188 - |
|
14 find-menu appears in editor element which has had makeEditable() called but designMode not set"> |
|
15 |
|
16 <script type="application/javascript"><![CDATA[ |
|
17 var gFindBar = null; |
|
18 var gBrowser; |
|
19 |
|
20 function ok(condition, message) { |
|
21 window.opener.wrappedJSObject.SimpleTest.ok(condition, message); |
|
22 } |
|
23 function finish() { |
|
24 window.close(); |
|
25 window.opener.wrappedJSObject.SimpleTest.finish(); |
|
26 } |
|
27 |
|
28 function onLoad() { |
|
29 gFindBar = document.getElementById("FindToolbar"); |
|
30 gBrowser = document.getElementById("content"); |
|
31 var webnav = gBrowser.webNavigation; |
|
32 var edsession = webnav.QueryInterface(Components.interfaces.nsIInterfaceRequestor) |
|
33 .getInterface(Components.interfaces.nsIEditingSession); |
|
34 edsession.makeWindowEditable(gBrowser.contentWindow, "html", false, true, false); |
|
35 gBrowser.contentWindow.focus(); |
|
36 enterStringIntoEditor("'"); |
|
37 enterStringIntoEditor("/"); |
|
38 ok(gFindBar.hidden, |
|
39 "Findfield should have stayed hidden after entering editor test"); |
|
40 finish(); |
|
41 } |
|
42 |
|
43 function enterStringIntoEditor(aString) { |
|
44 for (var i=0; i < aString.length; i++) { |
|
45 var event = gBrowser.contentDocument.createEvent("KeyEvents"); |
|
46 event.initKeyEvent("keypress", true, true, null, false, false, |
|
47 false, false, 0, aString.charCodeAt(i)); |
|
48 gBrowser.contentDocument.body.dispatchEvent(event); |
|
49 } |
|
50 } |
|
51 ]]></script> |
|
52 |
|
53 <browser id="content" flex="1" src="data:text/html;charset=utf-8,some%20random%20text" type="content-primary"/> |
|
54 <findbar id="FindToolbar" browserid="content"/> |
|
55 </window> |