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_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ | 5 #ifndef CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ |
6 #define CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ | 6 #define CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/win/scoped_handle.h" | 13 #include "base/win/scoped_handle.h" |
14 #include "chrome/app/scoped_ole_initializer.h" | 14 #include "chrome/app/scoped_ole_initializer.h" |
15 #include "chrome/browser/browser_process_impl.h" | 15 #include "chrome/browser/browser_process_impl.h" |
16 #include "chrome_frame/test_utils.h" | 16 #include "chrome_frame/test_utils.h" |
17 #include "chrome_frame/test/test_server.h" | 17 #include "chrome_frame/test/test_server.h" |
18 #include "chrome_frame/test/net/test_automation_provider.h" | 18 #include "chrome_frame/test/net/test_automation_provider.h" |
19 #include "chrome_frame/test/net/process_singleton_subclass.h" | 19 #include "chrome_frame/test/net/process_singleton_subclass.h" |
20 #include "content/browser/browser_thread.h" | 20 #include "content/browser/browser_thread.h" |
21 #include "net/base/net_test_suite.h" | 21 #include "net/base/net_test_suite.h" |
22 | 22 |
23 class ProcessSingleton; | 23 class ProcessSingleton; |
| 24 class NotificationService; |
24 | 25 |
25 class FakeExternalTab { | 26 class FakeExternalTab { |
26 public: | 27 public: |
27 FakeExternalTab(); | 28 FakeExternalTab(); |
28 virtual ~FakeExternalTab(); | 29 virtual ~FakeExternalTab(); |
29 | 30 |
30 virtual void Initialize(); | 31 virtual void Initialize(); |
31 virtual void Shutdown(); | 32 virtual void Shutdown(); |
32 | 33 |
33 const FilePath& user_data() const { | 34 const FilePath& user_data() const { |
34 return user_data_dir_; | 35 return user_data_dir_; |
35 } | 36 } |
36 | 37 |
37 MessageLoopForUI* ui_loop() { | 38 MessageLoopForUI* ui_loop() { |
38 return &loop_; | 39 return &loop_; |
39 } | 40 } |
40 | 41 |
41 protected: | 42 protected: |
42 MessageLoopForUI loop_; | 43 MessageLoopForUI loop_; |
43 scoped_ptr<BrowserProcess> browser_process_; | 44 scoped_ptr<BrowserProcess> browser_process_; |
44 FilePath overridden_user_dir_; | 45 FilePath overridden_user_dir_; |
45 FilePath user_data_dir_; | 46 FilePath user_data_dir_; |
46 scoped_ptr<ProcessSingleton> process_singleton_; | 47 scoped_ptr<ProcessSingleton> process_singleton_; |
| 48 scoped_ptr<NotificationService> notificaton_service_; |
47 }; | 49 }; |
48 | 50 |
49 // The "master class" that spins the UI and test threads. | 51 // The "master class" that spins the UI and test threads. |
50 class CFUrlRequestUnittestRunner | 52 class CFUrlRequestUnittestRunner |
51 : public NetTestSuite, | 53 : public NetTestSuite, |
52 public ProcessSingletonSubclassDelegate, | 54 public ProcessSingletonSubclassDelegate, |
53 public TestAutomationProviderDelegate { | 55 public TestAutomationProviderDelegate { |
54 public: | 56 public: |
55 CFUrlRequestUnittestRunner(int argc, char** argv); | 57 CFUrlRequestUnittestRunner(int argc, char** argv); |
56 ~CFUrlRequestUnittestRunner(); | 58 ~CFUrlRequestUnittestRunner(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // The fake chrome instance. This instance owns the UI message loop | 101 // The fake chrome instance. This instance owns the UI message loop |
100 // on the main thread. | 102 // on the main thread. |
101 FakeExternalTab fake_chrome_; | 103 FakeExternalTab fake_chrome_; |
102 scoped_ptr<ProcessSingletonSubclass> pss_subclass_; | 104 scoped_ptr<ProcessSingletonSubclass> pss_subclass_; |
103 scoped_ptr<BrowserThread> main_thread_; | 105 scoped_ptr<BrowserThread> main_thread_; |
104 ScopedChromeFrameRegistrar registrar_; | 106 ScopedChromeFrameRegistrar registrar_; |
105 int test_result_; | 107 int test_result_; |
106 }; | 108 }; |
107 | 109 |
108 #endif // CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ | 110 #endif // CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ |
OLD | NEW |