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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_MANAGER_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_MANAGER_UNITTEST_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_MANAGER_UNITTEST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_MANAGER_UNITTEST_H_ |
7 | 7 |
8 #include "chrome/browser/chromeos/login/owner_manager.h" | 8 #include "chrome/browser/chromeos/login/owner_manager.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "content/common/content_notification_types.h" |
17 #include "content/common/notification_observer.h" | 18 #include "content/common/notification_observer.h" |
18 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
19 #include "content/common/notification_service.h" | 20 #include "content/common/notification_service.h" |
20 #include "content/common/notification_type.h" | |
21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
24 | 24 |
25 namespace chromeos { | 25 namespace chromeos { |
26 class MockKeyLoadObserver : public NotificationObserver { | 26 class MockKeyLoadObserver : public NotificationObserver { |
27 public: | 27 public: |
28 explicit MockKeyLoadObserver(base::WaitableEvent* e); | 28 explicit MockKeyLoadObserver(base::WaitableEvent* e); |
29 virtual ~MockKeyLoadObserver(); | 29 virtual ~MockKeyLoadObserver(); |
30 | 30 |
31 // NotificationObserver implementation. | 31 // NotificationObserver implementation. |
32 virtual void Observe(NotificationType type, | 32 virtual void Observe(int type, |
33 const NotificationSource& source, | 33 const NotificationSource& source, |
34 const NotificationDetails& details); | 34 const NotificationDetails& details); |
35 | 35 |
36 void ExpectKeyFetchSuccess(bool should_succeed); | 36 void ExpectKeyFetchSuccess(bool should_succeed); |
37 | 37 |
38 private: | 38 private: |
39 NotificationRegistrar registrar_; | 39 NotificationRegistrar registrar_; |
40 bool success_expected_; | 40 bool success_expected_; |
41 base::WaitableEvent* event_; | 41 base::WaitableEvent* event_; |
42 bool observed_; | 42 bool observed_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const std::vector<uint8> expected_sig_; | 84 const std::vector<uint8> expected_sig_; |
85 | 85 |
86 private: | 86 private: |
87 base::WaitableEvent* event_; | 87 base::WaitableEvent* event_; |
88 DISALLOW_COPY_AND_ASSIGN(MockSigner); | 88 DISALLOW_COPY_AND_ASSIGN(MockSigner); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace chromeos | 91 } // namespace chromeos |
92 | 92 |
93 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_MANAGER_UNITTEST_H_ | 93 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_MANAGER_UNITTEST_H_ |
OLD | NEW |