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

Side by Side Diff: chrome/browser/sync/about_sync_util_unittest.cc

Issue 340643002: Use TestBrowserThreadBundle instead of TestBrowserThread in sync code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_data_type_controller_unittest.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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 #include "chrome/browser/sync/about_sync_util.h" 7 #include "chrome/browser/sync/about_sync_util.h"
8 #include "chrome/browser/sync/profile_sync_service_mock.h" 8 #include "chrome/browser/sync/profile_sync_service_mock.h"
9 #include "content/public/test/test_browser_thread.h" 9 #include "content/public/test/test_browser_thread_bundle.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 using ::testing::NiceMock; 13 using ::testing::NiceMock;
14 using ::testing::Return; 14 using ::testing::Return;
15 using ::testing::_; 15 using ::testing::_;
16 using content::BrowserThread;
17 16
18 namespace sync_ui_util { 17 namespace sync_ui_util {
19 namespace { 18 namespace {
20 19
21 TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) { 20 TEST(SyncUIUtilTestAbout, ConstructAboutInformationWithUnrecoverableErrorTest) {
22 base::MessageLoopForUI message_loop; 21 content::TestBrowserThreadBundle thread_bundle(
23 content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); 22 content::TestBrowserThreadBundle::DEFAULT);
24 scoped_ptr<Profile> profile( 23 scoped_ptr<Profile> profile(
25 ProfileSyncServiceMock::MakeSignedInTestingProfile()); 24 ProfileSyncServiceMock::MakeSignedInTestingProfile());
26 NiceMock<ProfileSyncServiceMock> service(profile.get()); 25 NiceMock<ProfileSyncServiceMock> service(profile.get());
27 26
28 // Will be released when the dictionary is destroyed 27 // Will be released when the dictionary is destroyed
29 base::string16 str(base::ASCIIToUTF16("none")); 28 base::string16 str(base::ASCIIToUTF16("none"));
30 29
31 browser_sync::SyncBackendHost::Status status; 30 browser_sync::SyncBackendHost::Status status;
32 31
33 EXPECT_CALL(service, HasSyncSetupCompleted()) 32 EXPECT_CALL(service, HasSyncSetupCompleted())
34 .WillOnce(Return(true)); 33 .WillOnce(Return(true));
35 EXPECT_CALL(service, QueryDetailedSyncStatus(_)) 34 EXPECT_CALL(service, QueryDetailedSyncStatus(_))
36 .WillOnce(Return(false)); 35 .WillOnce(Return(false));
37 36
38 EXPECT_CALL(service, HasUnrecoverableError()) 37 EXPECT_CALL(service, HasUnrecoverableError())
39 .WillRepeatedly(Return(true)); 38 .WillRepeatedly(Return(true));
40 39
41 EXPECT_CALL(service, GetLastSyncedTimeString()) 40 EXPECT_CALL(service, GetLastSyncedTimeString())
42 .WillOnce(Return(str)); 41 .WillOnce(Return(str));
43 42
44 scoped_ptr<base::DictionaryValue> strings( 43 scoped_ptr<base::DictionaryValue> strings(
45 ConstructAboutInformation(&service)); 44 ConstructAboutInformation(&service));
46 45
47 EXPECT_TRUE(strings->HasKey("unrecoverable_error_detected")); 46 EXPECT_TRUE(strings->HasKey("unrecoverable_error_detected"));
48 } 47 }
49 48
50 } // namespace 49 } // namespace
51 } // namespace sync_ui_util 50 } // namespace sync_ui_util
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698