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/ui/webui/sync_internals_ui.h" | 5 #include "chrome/browser/ui/webui/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" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/sync/js/js_arg_list.h" | 13 #include "chrome/browser/sync/js/js_arg_list.h" |
14 #include "chrome/browser/sync/js/js_event_details.h" | 14 #include "chrome/browser/sync/js/js_event_details.h" |
15 #include "chrome/browser/sync/js/js_test_util.h" | 15 #include "chrome/browser/sync/js/js_test_util.h" |
16 #include "chrome/browser/sync/profile_sync_service_mock.h" | 16 #include "chrome/browser/sync/profile_sync_service_mock.h" |
17 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 17 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
18 #include "chrome/test/base/profile_mock.h" | 18 #include "chrome/test/base/profile_mock.h" |
19 #include "content/browser/tab_contents/test_tab_contents.h" | 19 #include "content/browser/tab_contents/test_tab_contents.h" |
20 #include "content/test/test_browser_thread.h" | 20 #include "content/test/test_browser_thread.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 namespace { | 24 namespace { |
25 | 25 |
26 using browser_sync::HasArgsAsList; | 26 using browser_sync::HasArgsAsList; |
27 using browser_sync::JsArgList; | 27 using browser_sync::JsArgList; |
28 using browser_sync::JsEventDetails; | 28 using browser_sync::JsEventDetails; |
| 29 using content::BrowserThread; |
29 using testing::_; | 30 using testing::_; |
30 using testing::Mock; | 31 using testing::Mock; |
31 using testing::NiceMock; | 32 using testing::NiceMock; |
32 using testing::Return; | 33 using testing::Return; |
33 using testing::StrictMock; | 34 using testing::StrictMock; |
34 | 35 |
35 // Subclass of SyncInternalsUI to mock out ExecuteJavascript. | 36 // Subclass of SyncInternalsUI to mock out ExecuteJavascript. |
36 class TestSyncInternalsUI : public SyncInternalsUI { | 37 class TestSyncInternalsUI : public SyncInternalsUI { |
37 public: | 38 public: |
38 explicit TestSyncInternalsUI(TabContents* contents) | 39 explicit TestSyncInternalsUI(TabContents* contents) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 const char kAboutInfoCall[] = | 192 const char kAboutInfoCall[] = |
192 "chrome.sync.getAboutInfo.handleReply({\"summary\":\"SYNC DISABLED\"});"; | 193 "chrome.sync.getAboutInfo.handleReply({\"summary\":\"SYNC DISABLED\"});"; |
193 EXPECT_CALL(*test_sync_internals_ui_, | 194 EXPECT_CALL(*test_sync_internals_ui_, |
194 ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall))); | 195 ExecuteJavascript(ASCIIToUTF16(kAboutInfoCall))); |
195 | 196 |
196 ListValue args; | 197 ListValue args; |
197 test_sync_internals_ui_->OnWebUISend(GURL(), "getAboutInfo", args); | 198 test_sync_internals_ui_->OnWebUISend(GURL(), "getAboutInfo", args); |
198 } | 199 } |
199 | 200 |
200 } // namespace | 201 } // namespace |
OLD | NEW |