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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_apitest.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes Created 4 years, 7 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 // 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 testing::Message msg("Expected: "); 483 testing::Message msg("Expected: ");
484 for (std::vector<std::string>::const_iterator it = accounts.begin(); 484 for (std::vector<std::string>::const_iterator it = accounts.begin();
485 it != accounts.end(); 485 it != accounts.end();
486 ++it) { 486 ++it) {
487 msg << *it << " "; 487 msg << *it << " ";
488 } 488 }
489 msg << "Actual: "; 489 msg << "Actual: ";
490 if (!results) { 490 if (!results) {
491 msg << "NULL"; 491 msg << "NULL";
492 } else { 492 } else {
493 for (base::ListValue::const_iterator it = results->begin(); 493 for (const auto& result : *results) {
494 it != results->end();
495 ++it) {
496 std::unique_ptr<api::identity::AccountInfo> info = 494 std::unique_ptr<api::identity::AccountInfo> info =
497 api::identity::AccountInfo::FromValue(**it); 495 api::identity::AccountInfo::FromValue(*result);
498 if (info.get()) 496 if (info.get())
499 msg << info->id << " "; 497 msg << info->id << " ";
500 else 498 else
501 msg << *it << "<-" << (*it)->GetType() << " "; 499 msg << *result << "<-" << result->GetType() << " ";
502 } 500 }
503 } 501 }
504 502
505 return testing::AssertionFailure(msg); 503 return testing::AssertionFailure(msg);
506 } 504 }
507 }; 505 };
508 506
509 IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, MultiAccountOn) { 507 IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, MultiAccountOn) {
510 EXPECT_TRUE(switches::IsExtensionsMultiAccount()); 508 EXPECT_TRUE(switches::IsExtensionsMultiAccount());
511 } 509 }
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), 1896 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"),
1899 url); 1897 url);
1900 } 1898 }
1901 1899
1902 } // namespace extensions 1900 } // namespace extensions
1903 1901
1904 // Tests the chrome.identity API implemented by custom JS bindings . 1902 // Tests the chrome.identity API implemented by custom JS bindings .
1905 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { 1903 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) {
1906 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; 1904 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_;
1907 } 1905 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698