Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: content/browser/debugger/devtools_manager_unittest.cc

Issue 9965091: Clean up RenderViewHostManager swapping logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge and clean up comments. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/time.h" 6 #include "base/time.h"
7 #include "content/browser/debugger/devtools_manager_impl.h" 7 #include "content/browser/debugger/devtools_manager_impl.h"
8 #include "content/browser/debugger/render_view_devtools_agent_host.h" 8 #include "content/browser/debugger/render_view_devtools_agent_host.h"
9 #include "content/browser/mock_content_browser_client.h" 9 #include "content/browser/mock_content_browser_client.h"
10 #include "content/browser/renderer_host/test_render_view_host.h" 10 #include "content/browser/renderer_host/test_render_view_host.h"
11 #include "content/browser/web_contents/test_web_contents.h" 11 #include "content/browser/web_contents/test_web_contents.h"
12 #include "content/common/view_messages.h" 12 #include "content/common/view_messages.h"
13 #include "content/public/browser/browser_context.h"
darin (slow to review) 2012/05/31 04:43:08 nit: this include is not needed, right?
Charlie Reis 2012/05/31 17:58:23 Done.
13 #include "content/public/browser/content_browser_client.h" 14 #include "content/public/browser/content_browser_client.h"
14 #include "content/public/browser/devtools_agent_host_registry.h" 15 #include "content/public/browser/devtools_agent_host_registry.h"
15 #include "content/public/browser/devtools_client_host.h" 16 #include "content/public/browser/devtools_client_host.h"
16 #include "content/public/browser/web_contents_delegate.h" 17 #include "content/public/browser/web_contents_delegate.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 using base::TimeDelta; 20 using base::TimeDelta;
20 using content::DevToolsAgentHost; 21 using content::DevToolsAgentHost;
21 using content::DevToolsAgentHostRegistry; 22 using content::DevToolsAgentHostRegistry;
22 using content::DevToolsClientHost; 23 using content::DevToolsClientHost;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 private: 91 private:
91 bool renderer_unresponsive_received_; 92 bool renderer_unresponsive_received_;
92 }; 93 };
93 94
94 class DevToolsManagerTestBrowserClient 95 class DevToolsManagerTestBrowserClient
95 : public content::MockContentBrowserClient { 96 : public content::MockContentBrowserClient {
96 public: 97 public:
97 DevToolsManagerTestBrowserClient() { 98 DevToolsManagerTestBrowserClient() {
98 } 99 }
99 100
100 virtual bool ShouldSwapProcessesForNavigation( 101 virtual bool ShouldSwapBrowsingInstancesForNavigation(
102 content::BrowserContext* browser_context,
101 const GURL& current_url, 103 const GURL& current_url,
102 const GURL& new_url) OVERRIDE { 104 const GURL& new_url) OVERRIDE {
103 return true; 105 return true;
104 } 106 }
105 107
106 private: 108 private:
107 DISALLOW_COPY_AND_ASSIGN(DevToolsManagerTestBrowserClient); 109 DISALLOW_COPY_AND_ASSIGN(DevToolsManagerTestBrowserClient);
108 }; 110 };
109 111
110 } // namespace 112 } // namespace
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 238
237 // Interrupt pending navigation and navigate back to the original site. 239 // Interrupt pending navigation and navigate back to the original site.
238 controller().LoadURL( 240 controller().LoadURL(
239 url, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string()); 241 url, content::Referrer(), content::PAGE_TRANSITION_TYPED, std::string());
240 contents()->TestDidNavigate(rvh(), 1, url, content::PAGE_TRANSITION_TYPED); 242 contents()->TestDidNavigate(rvh(), 1, url, content::PAGE_TRANSITION_TYPED);
241 EXPECT_FALSE(contents()->cross_navigation_pending()); 243 EXPECT_FALSE(contents()->cross_navigation_pending());
242 EXPECT_EQ(&client_host, devtools_manager->GetDevToolsClientHostFor( 244 EXPECT_EQ(&client_host, devtools_manager->GetDevToolsClientHostFor(
243 DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh()))); 245 DevToolsAgentHostRegistry::GetDevToolsAgentHost(rvh())));
244 client_host.Close(DevToolsManager::GetInstance()); 246 client_host.Close(DevToolsManager::GetInstance());
245 } 247 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698