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

Side by Side Diff: ios/chrome/browser/device_sharing/device_sharing_manager_unittest.mm

Issue 2591823003: Remove ChromeBrowserProvider::RegisterProfilePrefs(). (Closed)
Patch Set: Fix multiple registration of preferences. Created 3 years, 12 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 | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/downstream_chromium_browser_provider.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/device_sharing/device_sharing_manager.h" 5 #include "ios/chrome/browser/device_sharing/device_sharing_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 23 matching lines...) Expand all
34 protected: 34 protected:
35 DeviceSharingManagerTest() 35 DeviceSharingManagerTest()
36 : PlatformTest(), 36 : PlatformTest(),
37 kTestURL1("http://test_sharing_1.html"), 37 kTestURL1("http://test_sharing_1.html"),
38 kTestURL2("http://test_sharing_2.html") {} 38 kTestURL2("http://test_sharing_2.html") {}
39 39
40 void SetUp() override { 40 void SetUp() override {
41 PlatformTest::SetUp(); 41 PlatformTest::SetUp();
42 TestChromeBrowserState::Builder mainBrowserStateBuilder; 42 TestChromeBrowserState::Builder mainBrowserStateBuilder;
43 chrome_browser_state_ = mainBrowserStateBuilder.Build(); 43 chrome_browser_state_ = mainBrowserStateBuilder.Build();
44 sync_preferences::TestingPrefServiceSyncable* prefs =
45 chrome_browser_state_->GetTestingPrefService();
46 [HandoffManager registerBrowserStatePrefs:prefs->registry()];
47 sharing_manager_.reset([[TestDeviceSharingManager alloc] init]); 44 sharing_manager_.reset([[TestDeviceSharingManager alloc] init]);
48 } 45 }
49 46
50 void TearDown() override { 47 void TearDown() override {
51 [sharing_manager_ updateBrowserState:NULL]; 48 [sharing_manager_ updateBrowserState:NULL];
52 sharing_manager_.reset(); 49 sharing_manager_.reset();
53 } 50 }
54 51
55 const GURL kTestURL1; 52 const GURL kTestURL1;
56 const GURL kTestURL2; 53 const GURL kTestURL2;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 TEST_F(DeviceSharingManagerTest, DisableHandoffViaPrefs) { 104 TEST_F(DeviceSharingManagerTest, DisableHandoffViaPrefs) {
108 [sharing_manager_ updateBrowserState:chrome_browser_state_.get()]; 105 [sharing_manager_ updateBrowserState:chrome_browser_state_.get()];
109 EXPECT_TRUE([sharing_manager_ handoffManager]); 106 EXPECT_TRUE([sharing_manager_ handoffManager]);
110 sync_preferences::TestingPrefServiceSyncable* prefs = 107 sync_preferences::TestingPrefServiceSyncable* prefs =
111 chrome_browser_state_->GetTestingPrefService(); 108 chrome_browser_state_->GetTestingPrefService();
112 prefs->SetBoolean(prefs::kIosHandoffToOtherDevices, false); 109 prefs->SetBoolean(prefs::kIosHandoffToOtherDevices, false);
113 EXPECT_FALSE([sharing_manager_ handoffManager]); 110 EXPECT_FALSE([sharing_manager_ handoffManager]);
114 } 111 }
115 112
116 } // namespace 113 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/downstream_chromium_browser_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698