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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 EXPECT_EQ(emptyAtom, atomicString); 281 EXPECT_EQ(emptyAtom, atomicString);
282 } 282 }
283 { // AtomicString constructed from an empty char* string. 283 { // AtomicString constructed from an empty char* string.
284 StringBuilder builder; 284 StringBuilder builder;
285 builder.append("", 0); 285 builder.append("", 0);
286 AtomicString atomicString = builder.toAtomicString(); 286 AtomicString atomicString = builder.toAtomicString();
287 EXPECT_EQ(emptyAtom, atomicString); 287 EXPECT_EQ(emptyAtom, atomicString);
288 } 288 }
289 { // Cleared StringBuilder. 289 { // Cleared StringBuilder.
290 StringBuilder builder; 290 StringBuilder builder;
291 builder.appendLiteral("WebKit"); 291 builder.append("WebKit");
292 builder.clear(); 292 builder.clear();
293 AtomicString atomicString = builder.toAtomicString(); 293 AtomicString atomicString = builder.toAtomicString();
294 EXPECT_EQ(emptyAtom, atomicString); 294 EXPECT_EQ(emptyAtom, atomicString);
295 } 295 }
296 } 296 }
297 297
298 TEST(StringBuilderTest, Substring) 298 TEST(StringBuilderTest, Substring)
299 { 299 {
300 { // Default constructed. 300 { // Default constructed.
301 StringBuilder builder; 301 StringBuilder builder;
(...skipping 15 matching lines...) Expand all
317 StringBuilder reference; 317 StringBuilder reference;
318 reference.append(replacementCharacter); // Make it UTF-16. 318 reference.append(replacementCharacter); // Make it UTF-16.
319 reference.append(String::number(someNumber)); 319 reference.append(String::number(someNumber));
320 StringBuilder test; 320 StringBuilder test;
321 test.append(replacementCharacter); 321 test.append(replacementCharacter);
322 test.appendNumber(someNumber); 322 test.appendNumber(someNumber);
323 EXPECT_EQ(reference, test); 323 EXPECT_EQ(reference, test);
324 } 324 }
325 325
326 } // namespace WTF 326 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698