Chromium Code Reviews| 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/dom_ui/sync_internals_ui.h" | 5 #include "chrome/browser/dom_ui/sync_internals_ui.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 return NULL; | 103 return NULL; |
| 104 } | 104 } |
| 105 return GetTestSyncInternalsUIAddress(); | 105 return GetTestSyncInternalsUIAddress(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Used for passing into EXPECT_CALL(). | 108 // Used for passing into EXPECT_CALL(). |
| 109 TestSyncInternalsUI* GetTestSyncInternalsUIAddress() { | 109 TestSyncInternalsUI* GetTestSyncInternalsUIAddress() { |
| 110 return static_cast<TestSyncInternalsUI*>(test_sync_internals_ui_buf_); | 110 return static_cast<TestSyncInternalsUI*>(test_sync_internals_ui_buf_); |
| 111 } | 111 } |
| 112 | 112 |
| 113 private: | |
|
willchan no longer on Chromium
2011/02/08 04:57:52
Can these just be added to the protected section?
sky
2011/02/08 05:35:26
Moved to protected.
| |
| 114 // These need to be created before profile sync service. | |
| 115 // Needed by |ui_thread_|. | |
| 116 MessageLoopForUI ui_loop_; | |
| 117 // Needed by |test_tab_contents_|. | |
| 118 BrowserThread ui_thread_; | |
| 119 | |
| 120 protected: | |
| 113 NiceMock<ProfileMock> profile_mock_; | 121 NiceMock<ProfileMock> profile_mock_; |
| 114 StrictMock<ProfileSyncServiceMock> profile_sync_service_mock_; | 122 StrictMock<ProfileSyncServiceMock> profile_sync_service_mock_; |
| 115 StrictMock<browser_sync::MockJsFrontend> mock_js_backend_; | 123 StrictMock<browser_sync::MockJsFrontend> mock_js_backend_; |
| 116 | 124 |
| 117 private: | 125 private: |
| 118 // Needed by |ui_thread_|. | |
| 119 MessageLoopForUI ui_loop_; | |
| 120 // Needed by |test_tab_contents_|. | |
| 121 BrowserThread ui_thread_; | |
| 122 TestTabContents test_tab_contents_; | 126 TestTabContents test_tab_contents_; |
| 123 void* test_sync_internals_ui_buf_; | 127 void* test_sync_internals_ui_buf_; |
| 124 bool test_sync_internals_ui_constructor_called_; | 128 bool test_sync_internals_ui_constructor_called_; |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 TEST_F(SyncInternalsUITest, HandleJsEvent) { | 131 TEST_F(SyncInternalsUITest, HandleJsEvent) { |
| 128 ExpectSetupTeardownCalls(); | 132 ExpectSetupTeardownCalls(); |
| 129 | 133 |
| 130 ConstructTestSyncInternalsUI(); | 134 ConstructTestSyncInternalsUI(); |
| 131 | 135 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 | 212 |
| 209 ConstructTestSyncInternalsUI(); | 213 ConstructTestSyncInternalsUI(); |
| 210 | 214 |
| 211 EXPECT_CALL(*GetTestSyncInternalsUI(), | 215 EXPECT_CALL(*GetTestSyncInternalsUI(), |
| 212 ExecuteJavascript(std::wstring(kAboutInfoCall))); | 216 ExecuteJavascript(std::wstring(kAboutInfoCall))); |
| 213 | 217 |
| 214 GetTestSyncInternalsUI()->ProcessDOMUIMessage(params); | 218 GetTestSyncInternalsUI()->ProcessDOMUIMessage(params); |
| 215 } | 219 } |
| 216 | 220 |
| 217 } // namespace | 221 } // namespace |
| OLD | NEW |