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

Side by Side Diff: third_party/WebKit/LayoutTests/jquery/resources/test/unit/manipulation.js

Issue 2157963002: Improve grammar in some comments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: maxiumum Created 4 years, 5 months 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
OLDNEW
1 module("manipulation", { teardown: moduleTeardown }); 1 module("manipulation", { teardown: moduleTeardown });
2 2
3 // Ensure that an extended Array prototype doesn't break jQuery 3 // Ensure that an extended Array prototype doesn't break jQuery
4 Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); }; 4 Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); };
5 5
6 var bareObj = function(value) { return value; }; 6 var bareObj = function(value) { return value; };
7 var functionReturningObj = function(value) { return (function() { return value; }); }; 7 var functionReturningObj = function(value) { return (function() { return value; }); };
8 8
9 test("text()", function() { 9 test("text()", function() {
10 expect(2); 10 expect(2);
11 var expected = "This link has class=\"blog\": Simon Willison's Weblog"; 11 var expected = "This link has class=\"blog\": Simon Willison's Weblog";
12 » equals( jQuery('#sap').text(), expected, 'Check for merged text of more then one element.' ); 12 » equals( jQuery('#sap').text(), expected, 'Check for merged text of more than one element.' );
13 13
14 // Check serialization of text values 14 // Check serialization of text values
15 equals( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." ); 15 equals( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." );
16 }); 16 });
17 17
18 var testText = function(valueObj) { 18 var testText = function(valueObj) {
19 expect(4); 19 expect(4);
20 var val = valueObj("<div><b>Hello</b> cruel world!</div>"); 20 var val = valueObj("<div><b>Hello</b> cruel world!</div>");
21 equals( jQuery("#foo").text(val)[0].innerHTML.replace(/>/g, "&gt;"), "&l t;div&gt;&lt;b&gt;Hello&lt;/b&gt; cruel world!&lt;/div&gt;", "Check escaped text " ); 21 equals( jQuery("#foo").text(val)[0].innerHTML.replace(/>/g, "&gt;"), "&l t;div&gt;&lt;b&gt;Hello&lt;/b&gt; cruel world!&lt;/div&gt;", "Check escaped text " );
22 22
(...skipping 18 matching lines...) Expand all
41 test("text(Function) with incoming value", function() { 41 test("text(Function) with incoming value", function() {
42 expect(2); 42 expect(2);
43 43
44 var old = "This link has class=\"blog\": Simon Willison's Weblog"; 44 var old = "This link has class=\"blog\": Simon Willison's Weblog";
45 45
46 jQuery('#sap').text(function(i, val) { 46 jQuery('#sap').text(function(i, val) {
47 equals( val, old, "Make sure the incoming value is correct." ); 47 equals( val, old, "Make sure the incoming value is correct." );
48 return "foobar"; 48 return "foobar";
49 }); 49 });
50 50
51 » equals( jQuery("#sap").text(), "foobar", 'Check for merged text of more then one element.' ); 51 » equals( jQuery("#sap").text(), "foobar", 'Check for merged text of more than one element.' );
52 52
53 QUnit.reset(); 53 QUnit.reset();
54 }); 54 });
55 55
56 var testWrap = function(val) { 56 var testWrap = function(val) {
57 expect(19); 57 expect(19);
58 var defaultText = 'Try them out:' 58 var defaultText = 'Try them out:'
59 var result = jQuery('#first').wrap(val( '<div class="red"><span></span>< /div>' )).text(); 59 var result = jQuery('#first').wrap(val( '<div class="red"><span></span>< /div>' )).text();
60 equals( defaultText, result, 'Check for wrapping of on-the-fly html' ); 60 equals( defaultText, result, 'Check for wrapping of on-the-fly html' );
61 ok( jQuery('#first').parent().parent().is('.red'), 'Check if wrapper has class "red"' ); 61 ok( jQuery('#first').parent().parent().is('.red'), 'Check if wrapper has class "red"' );
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 1353
1354 for ( var i=0; i < bad.length; i++ ) { 1354 for ( var i=0; i < bad.length; i++ ) {
1355 try { 1355 try {
1356 $f.append( bad[i] ); 1356 $f.append( bad[i] );
1357 } 1357 }
1358 catch(e) {} 1358 catch(e) {}
1359 } 1359 }
1360 equals($f.text(), bad.join(''), "Cached strings that match Object properties "); 1360 equals($f.text(), bad.join(''), "Cached strings that match Object properties ");
1361 $f.remove(); 1361 $f.remove();
1362 }); 1362 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698