OLD | NEW |
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/chromeos/login/ownership_service.h" | 5 #include "chrome/browser/chromeos/login/ownership_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
14 #include "chrome/browser/chromeos/login/mock_owner_key_utils.h" | 14 #include "chrome/browser/chromeos/login/mock_owner_key_utils.h" |
15 #include "chrome/browser/chromeos/login/owner_manager_unittest.h" | 15 #include "chrome/browser/chromeos/login/owner_manager_unittest.h" |
16 #include "chrome/test/base/testing_browser_process_test.h" | |
17 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
18 #include "crypto/nss_util.h" | 17 #include "crypto/nss_util.h" |
19 #include "crypto/rsa_private_key.h" | 18 #include "crypto/rsa_private_key.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
22 | 21 |
23 using ::crypto::RSAPrivateKey; | 22 using ::crypto::RSAPrivateKey; |
24 using ::testing::DoAll; | 23 using ::testing::DoAll; |
25 using ::testing::Eq; | 24 using ::testing::Eq; |
26 using ::testing::Invoke; | 25 using ::testing::Invoke; |
27 using ::testing::Return; | 26 using ::testing::Return; |
28 using ::testing::SetArgumentPointee; | 27 using ::testing::SetArgumentPointee; |
29 using ::testing::_; | 28 using ::testing::_; |
30 | 29 |
31 | 30 |
32 namespace chromeos { | 31 namespace chromeos { |
33 | 32 |
34 class OwnershipServiceTest : public TestingBrowserProcessTest { | 33 class OwnershipServiceTest : public testing::Test { |
35 public: | 34 public: |
36 OwnershipServiceTest() | 35 OwnershipServiceTest() |
37 : message_loop_(MessageLoop::TYPE_UI), | 36 : message_loop_(MessageLoop::TYPE_UI), |
38 ui_thread_(BrowserThread::UI, &message_loop_), | 37 ui_thread_(BrowserThread::UI, &message_loop_), |
39 file_thread_(BrowserThread::FILE), | 38 file_thread_(BrowserThread::FILE), |
40 mock_(new MockKeyUtils), | 39 mock_(new MockKeyUtils), |
41 injector_(mock_) /* injector_ takes ownership of mock_ */ { | 40 injector_(mock_) /* injector_ takes ownership of mock_ */ { |
42 } | 41 } |
43 virtual ~OwnershipServiceTest() {} | 42 virtual ~OwnershipServiceTest() {} |
44 | 43 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 226 |
228 base::WaitableEvent event(true, false); | 227 base::WaitableEvent event(true, false); |
229 MockKeyUser delegate(OwnerManager::OPERATION_FAILED, &event); | 228 MockKeyUser delegate(OwnerManager::OPERATION_FAILED, &event); |
230 service_->StartVerifyAttempt(data, sig, &delegate); | 229 service_->StartVerifyAttempt(data, sig, &delegate); |
231 | 230 |
232 while (!event.IsSignaled()) | 231 while (!event.IsSignaled()) |
233 message_loop_.RunAllPending(); | 232 message_loop_.RunAllPending(); |
234 } | 233 } |
235 | 234 |
236 } // namespace chromeos | 235 } // namespace chromeos |
OLD | NEW |