Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text / find-quotes.html
blob523c4a9b57bfff9ad80049a421d07394a5d8a20d
1 <html>
2 <head>
3 <script>
4 function canFind(target, specimen)
6 getSelection().empty();
7 document.body.innerHTML = specimen;
8 document.execCommand("FindString", false, target);
9 var result = getSelection().rangeCount != 0;
10 getSelection().empty();
11 return result;
14 var apostrophe = "'";
15 var hebrewPunctuationGeresh = String.fromCharCode(0x05F3);
16 var hebrewPunctuationGershayim = String.fromCharCode(0x05F4);
17 var leftDoubleQuotationMark = String.fromCharCode(0x201C);
18 var leftSingleQuotationMark = String.fromCharCode(0x2018);
19 var quotationMark = '"';
20 var rightDoubleQuotationMark = String.fromCharCode(0x201D);
21 var rightSingleQuotationMark = String.fromCharCode(0x2019);
23 var success = true;
25 var message = "FAILURE:";
27 function testFindExpectingSuccess(targetName, specimenName)
29 var target = eval(targetName);
30 var specimen = eval(specimenName);
31 if (canFind(target, specimen))
32 return;
33 success = false;
34 message += " Cannot find " + specimenName + " when searching for " + targetName + ".";
37 function testFindExpectingFailure(targetName, specimenName)
39 var target = eval(targetName);
40 var specimen = eval(specimenName);
41 if (!canFind(target, specimen))
42 return;
43 success = false;
44 message += " Found " + specimenName + " when searching for " + targetName + ".";
47 function runTests()
49 if (window.testRunner)
50 testRunner.dumpAsText();
52 var singleQuotes = [ "apostrophe", "hebrewPunctuationGeresh", "leftSingleQuotationMark", "rightSingleQuotationMark" ];
53 var doubleQuotes = [ "quotationMark", "hebrewPunctuationGershayim", "leftDoubleQuotationMark", "rightDoubleQuotationMark" ];
55 for (var i = 0; i < singleQuotes.length; ++i) {
56 for (var j = 0; j < singleQuotes.length; ++j)
57 testFindExpectingSuccess(singleQuotes[i], singleQuotes[j]);
60 for (var i = 0; i < doubleQuotes.length; ++i) {
61 for (var j = 0; j < doubleQuotes.length; ++j)
62 testFindExpectingSuccess(doubleQuotes[i], doubleQuotes[j]);
65 for (var i = 0; i < singleQuotes.length; ++i) {
66 for (var j = 0; j < doubleQuotes.length; ++j)
67 testFindExpectingFailure(singleQuotes[i], doubleQuotes[j]);
70 for (var i = 0; i < doubleQuotes.length; ++i) {
71 for (var j = 0; j < singleQuotes.length; ++j)
72 testFindExpectingFailure(doubleQuotes[i], singleQuotes[j]);
75 if (success)
76 message = "SUCCESS: Found all the quotes as expected.";
78 document.body.innerHTML = message;
80 </script>
81 </head>
82 <body onload="runTests()"></body>
83 </html>