summaryrefslogtreecommitdiffstats
path: root/content/browser/devtools/devtools_manager_unittest.cc
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-25 12:59:36 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-25 12:59:36 +0000
commit98f661180caf2e8118b2c3b440b65dec17e39b1b (patch)
tree8ee89dd444d52815678c61b813007735a24b89cd /content/browser/devtools/devtools_manager_unittest.cc
parentea0e4696055129fff54dea73be1b2b4f5699767c (diff)
downloadchromium_src-98f661180caf2e8118b2c3b440b65dec17e39b1b.zip
chromium_src-98f661180caf2e8118b2c3b440b65dec17e39b1b.tar.gz
chromium_src-98f661180caf2e8118b2c3b440b65dec17e39b1b.tar.bz2
DevTools: introduce public content::DevToolsAgentHost.
BUG=166824 TBR=jam Review URL: https://chromiumcodereview.appspot.com/11665025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174606 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/devtools/devtools_manager_unittest.cc')
-rw-r--r--content/browser/devtools/devtools_manager_unittest.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/content/browser/devtools/devtools_manager_unittest.cc b/content/browser/devtools/devtools_manager_unittest.cc
index 48fb62f..21f637b 100644
--- a/content/browser/devtools/devtools_manager_unittest.cc
+++ b/content/browser/devtools/devtools_manager_unittest.cc
@@ -10,7 +10,7 @@
#include "content/browser/web_contents/test_web_contents.h"
#include "content/common/view_messages.h"
#include "content/public/browser/content_browser_client.h"
-#include "content/public/browser/devtools_agent_host_registry.h"
+#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_client_host.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/test/test_content_browser_client.h"
@@ -127,8 +127,7 @@ class DevToolsManagerTest : public RenderViewHostImplTestHarness {
TEST_F(DevToolsManagerTest, OpenAndManuallyCloseDevToolsClientHost) {
DevToolsManagerImpl manager;
- DevToolsAgentHost* agent =
- DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh());
+ DevToolsAgentHost* agent = DevToolsAgentHost::GetFor(rvh());
DevToolsClientHost* host = manager.GetDevToolsClientHostFor(agent);
EXPECT_TRUE(NULL == host);
@@ -154,13 +153,12 @@ TEST_F(DevToolsManagerTest, ForwardMessageToClient) {
DevToolsManagerImpl manager;
TestDevToolsClientHost client_host;
- DevToolsAgentHost* agent_host =
- DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh());
+ DevToolsAgentHost* agent_host = DevToolsAgentHost::GetFor(rvh());
manager.RegisterDevToolsClientHostFor(agent_host, &client_host);
EXPECT_EQ(0, TestDevToolsClientHost::close_counter);
std::string m = "test message";
- agent_host = DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh());
+ agent_host = DevToolsAgentHost::GetFor(rvh());
manager.DispatchOnInspectorFrontend(agent_host, m);
EXPECT_TRUE(&m == client_host.last_sent_message);
@@ -176,8 +174,7 @@ TEST_F(DevToolsManagerTest, NoUnresponsiveDialogInInspectedContents) {
contents()->SetDelegate(&delegate);
TestDevToolsClientHost client_host;
- DevToolsAgentHost* agent_host =
- DevToolsAgentHostRegistry::GetDevToolsAgentHost(inspected_rvh);
+ DevToolsAgentHost* agent_host = DevToolsAgentHost::GetFor(inspected_rvh);
DevToolsManager::GetInstance()->
RegisterDevToolsClientHostFor(agent_host, &client_host);
@@ -214,7 +211,7 @@ TEST_F(DevToolsManagerTest, ReattachOnCancelPendingNavigation) {
TestDevToolsClientHost client_host;
DevToolsManager* devtools_manager = DevToolsManager::GetInstance();
devtools_manager->RegisterDevToolsClientHostFor(
- DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh()),
+ DevToolsAgentHost::GetFor(rvh()),
&client_host);
// Navigate to new site which should get a new RenderViewHost.
@@ -223,7 +220,7 @@ TEST_F(DevToolsManagerTest, ReattachOnCancelPendingNavigation) {
url2, Referrer(), PAGE_TRANSITION_TYPED, std::string());
EXPECT_TRUE(contents()->cross_navigation_pending());
EXPECT_EQ(&client_host, devtools_manager->GetDevToolsClientHostFor(
- DevToolsAgentHostRegistry::GetDevToolsAgentHost(pending_rvh())));
+ DevToolsAgentHost::GetFor(pending_rvh())));
// Interrupt pending navigation and navigate back to the original site.
controller().LoadURL(
@@ -231,7 +228,7 @@ TEST_F(DevToolsManagerTest, ReattachOnCancelPendingNavigation) {
contents()->TestDidNavigate(rvh(), 1, url, PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->cross_navigation_pending());
EXPECT_EQ(&client_host, devtools_manager->GetDevToolsClientHostFor(
- DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh())));
+ DevToolsAgentHost::GetFor(rvh())));
client_host.Close(DevToolsManager::GetInstance());
}