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

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

Issue 9109009: Introduce CloudPolicyClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore DCHECKS. Created 8 years, 7 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
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 "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"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 virtual ~CloudPolicyControllerTest() {} 71 virtual ~CloudPolicyControllerTest() {}
72 72
73 virtual void SetUp() { 73 virtual void SetUp() {
74 ASSERT_TRUE(temp_user_data_dir_.CreateUniqueTempDir()); 74 ASSERT_TRUE(temp_user_data_dir_.CreateUniqueTempDir());
75 cache_.reset(new UserPolicyCache( 75 cache_.reset(new UserPolicyCache(
76 temp_user_data_dir_.path().AppendASCII("CloudPolicyControllerTest"), 76 temp_user_data_dir_.path().AppendASCII("CloudPolicyControllerTest"),
77 false /* wait_for_policy_fetch */)); 77 false /* wait_for_policy_fetch */));
78 token_fetcher_.reset(new MockDeviceTokenFetcher(cache_.get())); 78 token_fetcher_.reset(new MockDeviceTokenFetcher(cache_.get()));
79 EXPECT_CALL(service_, StartJob(_)).Times(AnyNumber()); 79 EXPECT_CALL(service_, StartJob(_, _, _, _, _, _, _)).Times(AnyNumber());
80 data_store_.reset(CloudPolicyDataStore::CreateForUserPolicies()); 80 data_store_.reset(CloudPolicyDataStore::CreateForUserPolicies());
81 } 81 }
82 82
83 virtual void TearDown() { 83 virtual void TearDown() {
84 controller_.reset(); // Unregisters observers. 84 controller_.reset(); // Unregisters observers.
85 data_store_.reset(); 85 data_store_.reset();
86 } 86 }
87 87
88 void CreateNewController() { 88 void CreateNewController() {
89 controller_.reset(new CloudPolicyController( 89 controller_.reset(new CloudPolicyController(
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 .WillOnce(DoAll(InvokeWithoutArgs(&loop_, &MessageLoop::QuitNow), 374 .WillOnce(DoAll(InvokeWithoutArgs(&loop_, &MessageLoop::QuitNow),
375 service_.SucceedJob(response))); 375 service_.SucceedJob(response)));
376 CreateNewController(); 376 CreateNewController();
377 loop_.RunAllPending(); 377 loop_.RunAllPending();
378 EXPECT_EQ(CloudPolicySubsystem::NETWORK_ERROR, notifier_.state()); 378 EXPECT_EQ(CloudPolicySubsystem::NETWORK_ERROR, notifier_.state());
379 EXPECT_EQ(CloudPolicySubsystem::POLICY_NETWORK_ERROR, 379 EXPECT_EQ(CloudPolicySubsystem::POLICY_NETWORK_ERROR,
380 notifier_.error_details()); 380 notifier_.error_details());
381 } 381 }
382 382
383 } // namespace policy 383 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud_policy_client_unittest.cc ('k') | chrome/browser/policy/device_token_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698