| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/ref_counted.h" | 5 #include "base/ref_counted.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
| 8 #include "chrome/browser/debugger/devtools_client_host.h" | 8 #include "chrome/browser/debugger/devtools_client_host.h" |
| 9 #include "chrome/browser/debugger/devtools_manager.h" | 9 #include "chrome/browser/debugger/devtools_manager.h" |
| 10 #include "chrome/browser/extensions/extension_devtools_browsertest.h" | 10 #include "chrome/browser/extensions/extension_devtools_browsertest.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Setting the events should have caused an ExtensionDevToolsBridge to be | 75 // Setting the events should have caused an ExtensionDevToolsBridge to be |
| 76 // registered for the tab's RenderViewHost. | 76 // registered for the tab's RenderViewHost. |
| 77 DevToolsClientHost* devtools_client_host = | 77 DevToolsClientHost* devtools_client_host = |
| 78 devtools_manager->GetDevToolsClientHostFor( | 78 devtools_manager->GetDevToolsClientHostFor( |
| 79 tab_contents->render_view_host()); | 79 tab_contents->render_view_host()); |
| 80 ASSERT_TRUE(devtools_client_host); | 80 ASSERT_TRUE(devtools_client_host); |
| 81 | 81 |
| 82 // Test onPageEvent event. | 82 // Test onPageEvent event. |
| 83 result = false; | 83 result = false; |
| 84 | 84 |
| 85 DevToolsClientMsg_DispatchToAPU pageEventMessage(""); | 85 DevToolsClientMsg_DispatchOnInspectorFrontend pageEventMessage(""); |
| 86 devtools_client_host->SendMessageToClient(pageEventMessage); | 86 devtools_client_host->SendMessageToClient(pageEventMessage); |
| 87 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 87 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 88 host->render_view_host(), L"", L"testReceivePageEvent()", &result)); | 88 host->render_view_host(), L"", L"testReceivePageEvent()", &result)); |
| 89 EXPECT_TRUE(result); | 89 EXPECT_TRUE(result); |
| 90 | 90 |
| 91 // Test onTabClose event. | 91 // Test onTabClose event. |
| 92 result = false; | 92 result = false; |
| 93 devtools_manager->UnregisterDevToolsClientHostFor( | 93 devtools_manager->UnregisterDevToolsClientHostFor( |
| 94 tab_contents->render_view_host()); | 94 tab_contents->render_view_host()); |
| 95 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 95 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 // Removing the listeners from the second extension should tear the bridge | 152 // Removing the listeners from the second extension should tear the bridge |
| 153 // down. | 153 // down. |
| 154 result = false; | 154 result = false; |
| 155 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 155 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 156 host_two->render_view_host(), L"", L"unregisterListeners()", &result)); | 156 host_two->render_view_host(), L"", L"unregisterListeners()", &result)); |
| 157 EXPECT_TRUE(result); | 157 EXPECT_TRUE(result); |
| 158 ASSERT_FALSE(devtools_manager->GetDevToolsClientHostFor( | 158 ASSERT_FALSE(devtools_manager->GetDevToolsClientHostFor( |
| 159 tab_contents->render_view_host())); | 159 tab_contents->render_view_host())); |
| 160 } | 160 } |
| OLD | NEW |