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 |
| 25 namespace content { |
24 class NotificationService; | 26 class NotificationService; |
| 27 } |
25 | 28 |
26 class FakeExternalTab { | 29 class FakeExternalTab { |
27 public: | 30 public: |
28 FakeExternalTab(); | 31 FakeExternalTab(); |
29 virtual ~FakeExternalTab(); | 32 virtual ~FakeExternalTab(); |
30 | 33 |
31 virtual void Initialize(); | 34 virtual void Initialize(); |
32 virtual void Shutdown(); | 35 virtual void Shutdown(); |
33 | 36 |
34 const FilePath& user_data() const { | 37 const FilePath& user_data() const { |
35 return user_data_dir_; | 38 return user_data_dir_; |
36 } | 39 } |
37 | 40 |
38 MessageLoopForUI* ui_loop() { | 41 MessageLoopForUI* ui_loop() { |
39 return &loop_; | 42 return &loop_; |
40 } | 43 } |
41 | 44 |
42 protected: | 45 protected: |
43 MessageLoopForUI loop_; | 46 MessageLoopForUI loop_; |
44 scoped_ptr<BrowserProcess> browser_process_; | 47 scoped_ptr<BrowserProcess> browser_process_; |
45 FilePath overridden_user_dir_; | 48 FilePath overridden_user_dir_; |
46 FilePath user_data_dir_; | 49 FilePath user_data_dir_; |
47 scoped_ptr<ProcessSingleton> process_singleton_; | 50 scoped_ptr<ProcessSingleton> process_singleton_; |
48 scoped_ptr<NotificationService> notificaton_service_; | 51 scoped_ptr<content::NotificationService> notificaton_service_; |
49 }; | 52 }; |
50 | 53 |
51 // The "master class" that spins the UI and test threads. | 54 // The "master class" that spins the UI and test threads. |
52 class CFUrlRequestUnittestRunner | 55 class CFUrlRequestUnittestRunner |
53 : public NetTestSuite, | 56 : public NetTestSuite, |
54 public ProcessSingletonSubclassDelegate, | 57 public ProcessSingletonSubclassDelegate, |
55 public TestAutomationProviderDelegate { | 58 public TestAutomationProviderDelegate { |
56 public: | 59 public: |
57 CFUrlRequestUnittestRunner(int argc, char** argv); | 60 CFUrlRequestUnittestRunner(int argc, char** argv); |
58 ~CFUrlRequestUnittestRunner(); | 61 ~CFUrlRequestUnittestRunner(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // The fake chrome instance. This instance owns the UI message loop | 104 // The fake chrome instance. This instance owns the UI message loop |
102 // on the main thread. | 105 // on the main thread. |
103 FakeExternalTab fake_chrome_; | 106 FakeExternalTab fake_chrome_; |
104 scoped_ptr<ProcessSingletonSubclass> pss_subclass_; | 107 scoped_ptr<ProcessSingletonSubclass> pss_subclass_; |
105 scoped_ptr<BrowserThread> main_thread_; | 108 scoped_ptr<BrowserThread> main_thread_; |
106 ScopedChromeFrameRegistrar registrar_; | 109 ScopedChromeFrameRegistrar registrar_; |
107 int test_result_; | 110 int test_result_; |
108 }; | 111 }; |
109 | 112 |
110 #endif // CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ | 113 #endif // CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_ |
OLD | NEW |