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

Side by Side Diff: chrome_frame/test/data/context_menu.html

Issue 3656002: Rewrite text field context menu tests using accessiblity framework.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <html>
2 <head>
3 <meta http-equiv="x-ua-compatible" content="chrome=1" />
4 <script type="text/javascript" src="chrome_frame_tester_helpers.js">
5 </script>
6 <script>
7 // Default text value used to test cut/copy/paste etc.
8 var INIT_VAL = "SomeInitializedTextValue";
9
10 // Get selected text value in text field.
11 function getSelectionInTextField(id) {
12 var textField = document.getElementById(id);
13 var selectedValue = textField.value.substring(textField.selectionStart,
14 textField.selectionEnd);
15 return selectedValue;
16 }
17
18 function isExpectedResult(action) {
19 var txtFieldVal = document.getElementById("textField").value;
20 var res = false;
21
22 switch (action) {
23 case "selectall":
24 if (getSelectionInTextField("textField") == INIT_VAL) {
25 res = true;
26 } else {
27 res = false;
28 }
29 break;
30 }
31 return res;
32 }
33
34 // Verify the expected result based on action and post message to host.
35 function verifyTextFieldContents(event) {
kkania 2010/11/09 22:45:21 Now that we only have one action, let's simplify t
36 var action = event.data;
37
38 if (isExpectedResult(action)) {
39 window.externalHost.postMessage("OK");
40 } else {
41 window.externalHost.postMessage("Fail");
42 }
43 }
44
45 // Do some initialization work like setting text field value,
46 // and selecting the value by default before the test starts.
47 function init() {
48 var action = getURLParameter("action");
49
50 document.getElementById("textField").value = INIT_VAL;
51 document.getElementById("textField").focus();
52 if (action != "selectall") {
53 document.getElementById("textField").select();
54 }
55
56 window.externalHost.onmessage = verifyTextFieldContents;
57 }
58 </script>
59 </head>
60
61 <body leftmargin="0" topmargin="0" onload="init()">
62 <input type="text" name="textField" id="textField" size="25" value=""></td>
63 </body>
64 </html>
65
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698