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

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

Issue 6312121: Add initial device policy infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix race condition and tests. Created 9 years, 10 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) 2010 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 <string> 5 #include <string>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.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/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
11 #include "chrome/browser/net/gaia/token_service.h" 11 #include "chrome/browser/net/gaia/token_service.h"
12 #include "chrome/browser/policy/device_token_fetcher.h" 12 #include "chrome/browser/policy/device_token_fetcher.h"
13 #include "chrome/browser/policy/mock_device_management_backend.h" 13 #include "chrome/browser/policy/mock_device_management_backend.h"
14 #include "chrome/common/net/gaia/gaia_constants.h" 14 #include "chrome/common/net/gaia/gaia_constants.h"
15 #include "chrome/test/testing_device_token_fetcher.h"
16 #include "chrome/test/testing_profile.h" 15 #include "chrome/test/testing_profile.h"
17 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
19 18
19 #if 0
20
20 namespace policy { 21 namespace policy {
21 22
22 const char kTestToken[] = "device_token_fetcher_test_auth_token"; 23 const char kTestToken[] = "device_token_fetcher_test_auth_token";
23 24
24 using testing::_; 25 using testing::_;
25 using testing::Mock; 26 using testing::Mock;
26 27
27 class MockTokenAvailableObserver : public DeviceTokenFetcher::Observer { 28 class MockTokenAvailableObserver : public DeviceTokenFetcher::Observer {
28 public: 29 public:
29 MockTokenAvailableObserver() {} 30 MockTokenAvailableObserver() {}
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 fetcher2->Restart(); 243 fetcher2->Restart();
243 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( 244 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce(
244 MockDeviceManagementBackendSucceedRegister()); 245 MockDeviceManagementBackendSucceedRegister());
245 fetcher2->SimulateLogin(kTestManagedDomainUsername); 246 fetcher2->SimulateLogin(kTestManagedDomainUsername);
246 loop_.RunAllPending(); 247 loop_.RunAllPending();
247 ASSERT_FALSE(fetcher2->IsTokenPending()); 248 ASSERT_FALSE(fetcher2->IsTokenPending());
248 ASSERT_NE(device_token, fetcher2->GetDeviceToken()); 249 ASSERT_NE(device_token, fetcher2->GetDeviceToken());
249 } 250 }
250 251
251 } // namespace policy 252 } // namespace policy
253
254 #endif
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_token_fetcher.cc ('k') | chrome/browser/policy/profile_policy_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698