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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter_unittest.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/profile_resetter/profile_resetter.h" 5 #include "chrome/browser/profile_resetter/profile_resetter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 EXPECT_TRUE(settings->GetHomepage(&homepage)); 818 EXPECT_TRUE(settings->GetHomepage(&homepage));
819 EXPECT_EQ("http://www.foo.com", homepage); 819 EXPECT_EQ("http://www.foo.com", homepage);
820 820
821 std::unique_ptr<base::ListValue> startup_list( 821 std::unique_ptr<base::ListValue> startup_list(
822 settings->GetUrlsToRestoreOnStartup()); 822 settings->GetUrlsToRestoreOnStartup());
823 EXPECT_TRUE(startup_list); 823 EXPECT_TRUE(startup_list);
824 std::vector<std::string> startup_pages; 824 std::vector<std::string> startup_pages;
825 for (base::ListValue::iterator i = startup_list->begin(); 825 for (base::ListValue::iterator i = startup_list->begin();
826 i != startup_list->end(); ++i) { 826 i != startup_list->end(); ++i) {
827 std::string url; 827 std::string url;
828 EXPECT_TRUE(i->GetAsString(&url)); 828 EXPECT_TRUE((*i)->GetAsString(&url));
829 startup_pages.push_back(url); 829 startup_pages.push_back(url);
830 } 830 }
831 ASSERT_EQ(2u, startup_pages.size()); 831 ASSERT_EQ(2u, startup_pages.size());
832 EXPECT_EQ("http://goo.gl", startup_pages[0]); 832 EXPECT_EQ("http://goo.gl", startup_pages[0]);
833 EXPECT_EQ("http://foo.de", startup_pages[1]); 833 EXPECT_EQ("http://foo.de", startup_pages[1]);
834 } 834 }
835 835
836 TEST_F(ProfileResetterTest, CheckSnapshots) { 836 TEST_F(ProfileResetterTest, CheckSnapshots) {
837 ResettableSettingsSnapshot empty_snap(profile()); 837 ResettableSettingsSnapshot empty_snap(profile());
838 EXPECT_EQ(0, empty_snap.FindDifferentFields(empty_snap)); 838 EXPECT_EQ(0, empty_snap.FindDifferentFields(empty_snap));
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 new ResettableSettingsSnapshot(profile())); 1054 new ResettableSettingsSnapshot(profile()));
1055 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, 1055 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail,
1056 base::Unretained(&capture))); 1056 base::Unretained(&capture)));
1057 deleted_snapshot.reset(); 1057 deleted_snapshot.reset();
1058 // Running remaining tasks shouldn't trigger the callback to be called as 1058 // Running remaining tasks shouldn't trigger the callback to be called as
1059 // |deleted_snapshot| was deleted before it could run. 1059 // |deleted_snapshot| was deleted before it could run.
1060 base::RunLoop().RunUntilIdle(); 1060 base::RunLoop().RunUntilIdle();
1061 } 1061 }
1062 1062
1063 } // namespace 1063 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/printing/cloud_print/cloud_print_printer_list.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698