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

Side by Side Diff: chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 7 years, 1 month 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
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/chromeos/policy/device_policy_cros_browser_test.h" 5 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 ASSERT_EQ( 65 ASSERT_EQ(
66 file_util::WriteFile( 66 file_util::WriteFile(
67 owner_key_file, 67 owner_key_file,
68 reinterpret_cast<const char*>(vector_as_array(&owner_key_bits)), 68 reinterpret_cast<const char*>(vector_as_array(&owner_key_bits)),
69 owner_key_bits.size()), 69 owner_key_bits.size()),
70 static_cast<int>(owner_key_bits.size())); 70 static_cast<int>(owner_key_bits.size()));
71 ASSERT_TRUE(PathService::Override(chromeos::FILE_OWNER_KEY, owner_key_file)); 71 ASSERT_TRUE(PathService::Override(chromeos::FILE_OWNER_KEY, owner_key_file));
72 } 72 }
73 73
74 DevicePolicyCrosBrowserTest::DevicePolicyCrosBrowserTest() 74 DevicePolicyCrosBrowserTest::DevicePolicyCrosBrowserTest()
75 : fake_dbus_thread_manager_( 75 : fake_dbus_thread_manager_(new chromeos::FakeDBusThreadManager),
76 new chromeos::FakeDBusThreadManager) { 76 fake_session_manager_client_(new chromeos::FakeSessionManagerClient) {
77 fake_dbus_thread_manager_->SetFakeClients();
78 fake_dbus_thread_manager_->SetSessionManagerClient(
79 scoped_ptr<chromeos::SessionManagerClient>(fake_session_manager_client_));
77 } 80 }
78 81
79 DevicePolicyCrosBrowserTest::~DevicePolicyCrosBrowserTest() { 82 DevicePolicyCrosBrowserTest::~DevicePolicyCrosBrowserTest() {
80 } 83 }
81 84
82 void DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture() { 85 void DevicePolicyCrosBrowserTest::SetUpInProcessBrowserTestFixture() {
83 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager_); 86 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager_);
84 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); 87 InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
85 } 88 }
86 89
(...skipping 12 matching lines...) Expand all
99 102
100 void DevicePolicyCrosBrowserTest::RefreshDevicePolicy() { 103 void DevicePolicyCrosBrowserTest::RefreshDevicePolicy() {
101 // Reset the key to its original state. 104 // Reset the key to its original state.
102 device_policy()->SetDefaultSigningKey(); 105 device_policy()->SetDefaultSigningKey();
103 device_policy()->Build(); 106 device_policy()->Build();
104 session_manager_client()->set_device_policy(device_policy()->GetBlob()); 107 session_manager_client()->set_device_policy(device_policy()->GetBlob());
105 session_manager_client()->OnPropertyChangeComplete(true); 108 session_manager_client()->OnPropertyChangeComplete(true);
106 } 109 }
107 110
108 } // namespace policy 111 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698