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

Side by Side Diff: ppapi/tests/test_flash_clipboard.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_file_ref.cc ('k') | ppapi/tests/test_flash_file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/tests/test_flash_clipboard.h" 5 #include "ppapi/tests/test_flash_clipboard.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ppapi/cpp/instance.h" 10 #include "ppapi/cpp/instance.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 ASSERT_TRUE(IsFormatAvailableMatches(invalid_format, false)); 246 ASSERT_TRUE(IsFormatAvailableMatches(invalid_format, false));
247 std::string unused; 247 std::string unused;
248 ASSERT_FALSE(ReadStringVar(invalid_format, &unused)); 248 ASSERT_FALSE(ReadStringVar(invalid_format, &unused));
249 249
250 PASS(); 250 PASS();
251 } 251 }
252 252
253 std::string TestFlashClipboard::TestRegisterCustomFormat() { 253 std::string TestFlashClipboard::TestRegisterCustomFormat() {
254 // Test an empty name is rejected. 254 // Test an empty name is rejected.
255 uint32_t format_id = 255 uint32_t format_id =
256 pp::flash::Clipboard::RegisterCustomFormat(instance_, ""); 256 pp::flash::Clipboard::RegisterCustomFormat(instance_, std::string());
257 ASSERT_EQ(format_id, PP_FLASH_CLIPBOARD_FORMAT_INVALID); 257 ASSERT_EQ(format_id, PP_FLASH_CLIPBOARD_FORMAT_INVALID);
258 258
259 // Test a valid format name. 259 // Test a valid format name.
260 format_id = pp::flash::Clipboard::RegisterCustomFormat(instance_, "a-b"); 260 format_id = pp::flash::Clipboard::RegisterCustomFormat(instance_, "a-b");
261 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_INVALID); 261 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_INVALID);
262 // Make sure the format doesn't collide with predefined formats. 262 // Make sure the format doesn't collide with predefined formats.
263 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT); 263 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT);
264 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_HTML); 264 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_HTML);
265 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_RTF); 265 ASSERT_NE(format_id, PP_FLASH_CLIPBOARD_FORMAT_RTF);
266 266
267 // Check that if the same name is registered, the same id comes out. 267 // Check that if the same name is registered, the same id comes out.
268 uint32_t format_id2 = 268 uint32_t format_id2 =
269 pp::flash::Clipboard::RegisterCustomFormat(instance_, "a-b"); 269 pp::flash::Clipboard::RegisterCustomFormat(instance_, "a-b");
270 ASSERT_EQ(format_id, format_id2); 270 ASSERT_EQ(format_id, format_id2);
271 271
272 // Check that the second format registered has a different id. 272 // Check that the second format registered has a different id.
273 uint32_t format_id3 = 273 uint32_t format_id3 =
274 pp::flash::Clipboard::RegisterCustomFormat(instance_, "a-b-c"); 274 pp::flash::Clipboard::RegisterCustomFormat(instance_, "a-b-c");
275 ASSERT_NE(format_id, format_id3); 275 ASSERT_NE(format_id, format_id3);
276 276
277 PASS(); 277 PASS();
278 } 278 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_file_ref.cc ('k') | ppapi/tests/test_flash_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698