| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_frame/external_tab.h" | 5 #include "chrome_frame/external_tab.h" |
| 6 #include "base/task.h" | 6 #include "base/task.h" |
| 7 #include "base/thread.h" | 7 #include "base/thread.h" |
| 8 #include "base/tracked.h" | 8 #include "base/tracked.h" |
| 9 | 9 |
| 10 // #include "base/waitable_event.h" | 10 // #include "base/waitable_event.h" |
| 11 | 11 |
| 12 #include "chrome/test/automation/automation_messages.h" | 12 #include "chrome/common/automation_messages.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gmock_mutant.h" | 15 #include "testing/gmock_mutant.h" |
| 16 #include "chrome_frame/test/chrome_frame_test_utils.h" | 16 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 17 | 17 |
| 18 | 18 |
| 19 | 19 |
| 20 // DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy); | 20 // DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy); |
| 21 // DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate); | 21 // DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate); |
| 22 DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeProxyDelegate); | 22 DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeProxyDelegate); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 struct MockUIDelegate : public UIDelegate { | 34 struct MockUIDelegate : public UIDelegate { |
| 35 MOCK_METHOD2(OnNavigationStateChanged, void(int flags, | 35 MOCK_METHOD2(OnNavigationStateChanged, void(int flags, |
| 36 const IPC::NavigationInfo& nav_info)); | 36 const IPC::NavigationInfo& nav_info)); |
| 37 MOCK_METHOD1(OnUpdateTargetUrl, void(const std::wstring& new_target_url)); | 37 MOCK_METHOD1(OnUpdateTargetUrl, void(const std::wstring& new_target_url)); |
| 38 MOCK_METHOD3(OnExtensionInstalled, void(const FilePath& path, void* user_data, | 38 MOCK_METHOD3(OnExtensionInstalled, void(const FilePath& path, void* user_data, |
| 39 AutomationMsg_ExtensionResponseValues response)); | 39 AutomationMsg_ExtensionResponseValues response)); |
| 40 MOCK_METHOD1(OnLoad, void(const GURL& url)); | 40 MOCK_METHOD1(OnLoad, void(const GURL& url)); |
| 41 MOCK_METHOD3(OnMessageFromChromeFrame, void(const std::string& message, | 41 MOCK_METHOD3(OnMessageFromChromeFrame, void(const std::string& message, |
| 42 const std::string& origin, const std::string& target)); | 42 const std::string& origin, const std::string& target)); |
| 43 MOCK_METHOD3(OnHandleContextMenu, void(HANDLE menu_handle, int align_flags, | 43 MOCK_METHOD3(OnHandleContextMenu, void(HANDLE menu_handle, int align_flags, |
| 44 const IPC::ContextMenuParams& params)); | 44 const IPC::MiniContextMenuParams& params)); |
| 45 MOCK_METHOD1(OnHandleAccelerator, void(const MSG& accel_message)); | 45 MOCK_METHOD1(OnHandleAccelerator, void(const MSG& accel_message)); |
| 46 MOCK_METHOD1(OnTabbedOut, void(bool reverse)); | 46 MOCK_METHOD1(OnTabbedOut, void(bool reverse)); |
| 47 MOCK_METHOD1(OnGoToHistoryOffset, void(int offset)); | 47 MOCK_METHOD1(OnGoToHistoryOffset, void(int offset)); |
| 48 MOCK_METHOD3(OnOpenURL, void(const GURL& url_to_open, const GURL& referrer, | 48 MOCK_METHOD3(OnOpenURL, void(const GURL& url_to_open, const GURL& referrer, |
| 49 int open_disposition)); | 49 int open_disposition)); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 struct MockProxy : public ChromeProxy { | 52 struct MockProxy : public ChromeProxy { |
| 53 MOCK_METHOD1(RemoveBrowsingData, void(int remove_mask)); | 53 MOCK_METHOD1(RemoveBrowsingData, void(int remove_mask)); |
| 54 MOCK_METHOD3(InstallExtension, void(ChromeProxyDelegate* delegate, | 54 MOCK_METHOD3(InstallExtension, void(ChromeProxyDelegate* delegate, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 tab_params.is_widget_mode = false; | 235 tab_params.is_widget_mode = false; |
| 236 tab_params.url = initial_url; | 236 tab_params.url = initial_url; |
| 237 | 237 |
| 238 tab->CreateTab(tab_params, &ui_delegate); | 238 tab->CreateTab(tab_params, &ui_delegate); |
| 239 tab->Navigate("http://asgard.org", EmptyString(), true); | 239 tab->Navigate("http://asgard.org", EmptyString(), true); |
| 240 | 240 |
| 241 loop.RunFor(5); | 241 loop.RunFor(5); |
| 242 EXPECT_FALSE(loop.WasTimedOut()); | 242 EXPECT_FALSE(loop.WasTimedOut()); |
| 243 tab.reset(); | 243 tab.reset(); |
| 244 } | 244 } |
| OLD | NEW |