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

Side by Side Diff: chrome/browser/policy/cloud_policy_controller_unittest.cc

Issue 8437002: Move BrowserThread to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few updates. Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/policy/cloud_policy_controller.h" 5 #include "chrome/browser/policy/cloud_policy_controller.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "chrome/browser/policy/cloud_policy_data_store.h" 10 #include "chrome/browser/policy/cloud_policy_data_store.h"
11 #include "chrome/browser/policy/device_token_fetcher.h" 11 #include "chrome/browser/policy/device_token_fetcher.h"
12 #include "chrome/browser/policy/logging_work_scheduler.h" 12 #include "chrome/browser/policy/logging_work_scheduler.h"
13 #include "chrome/browser/policy/mock_device_management_backend.h" 13 #include "chrome/browser/policy/mock_device_management_backend.h"
14 #include "chrome/browser/policy/mock_device_management_service.h" 14 #include "chrome/browser/policy/mock_device_management_service.h"
15 #include "chrome/browser/policy/policy_notifier.h" 15 #include "chrome/browser/policy/policy_notifier.h"
16 #include "chrome/browser/policy/user_policy_cache.h" 16 #include "chrome/browser/policy/user_policy_cache.h"
17 #include "content/test/test_browser_thread.h" 17 #include "content/test/test_browser_thread.h"
18 #include "policy/policy_constants.h" 18 #include "policy/policy_constants.h"
19 #include "testing/gmock/include/gmock/gmock.h" 19 #include "testing/gmock/include/gmock/gmock.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 21
22 namespace policy { 22 namespace policy {
23 23
24 using ::testing::AnyNumber; 24 using ::testing::AnyNumber;
25 using ::testing::InSequence; 25 using ::testing::InSequence;
26 using ::testing::_; 26 using ::testing::_;
27 using content::BrowserThread;
27 28
28 class MockDeviceTokenFetcher : public DeviceTokenFetcher { 29 class MockDeviceTokenFetcher : public DeviceTokenFetcher {
29 public: 30 public:
30 explicit MockDeviceTokenFetcher(CloudPolicyCacheBase* cache) 31 explicit MockDeviceTokenFetcher(CloudPolicyCacheBase* cache)
31 : DeviceTokenFetcher(NULL, cache, NULL, NULL) {} 32 : DeviceTokenFetcher(NULL, cache, NULL, NULL) {}
32 virtual ~MockDeviceTokenFetcher() {} 33 virtual ~MockDeviceTokenFetcher() {}
33 34
34 MOCK_METHOD0(FetchToken, void()); 35 MOCK_METHOD0(FetchToken, void());
35 MOCK_METHOD0(SetUnmanagedState, void()); 36 MOCK_METHOD0(SetUnmanagedState, void());
36 MOCK_METHOD0(SetSerialNumberInvalidState, void()); 37 MOCK_METHOD0(SetSerialNumberInvalidState, void());
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 "who@what.com", "auth", true); 233 "who@what.com", "auth", true);
233 EXPECT_CALL(backend_, ProcessPolicyRequest(_, _, _, _, _)).WillOnce( 234 EXPECT_CALL(backend_, ProcessPolicyRequest(_, _, _, _, _)).WillOnce(
234 MockDeviceManagementBackendFailPolicy( 235 MockDeviceManagementBackendFailPolicy(
235 DeviceManagementBackend::kErrorServiceInvalidSerialNumber)); 236 DeviceManagementBackend::kErrorServiceInvalidSerialNumber));
236 EXPECT_CALL(*token_fetcher_.get(), SetSerialNumberInvalidState()).Times(1); 237 EXPECT_CALL(*token_fetcher_.get(), SetSerialNumberInvalidState()).Times(1);
237 CreateNewController(); 238 CreateNewController();
238 loop_.RunAllPending(); 239 loop_.RunAllPending();
239 } 240 }
240 241
241 } // namespace policy 242 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.cc ('k') | chrome/browser/policy/cloud_policy_subsystem_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698