OLD | NEW |
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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/devtools/devtools_window.h" | 6 #include "chrome/browser/devtools/devtools_window.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
9 #include "chrome/browser/ui/singleton_tabs.h" | 9 #include "chrome/browser/ui/singleton_tabs.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // the renderer process to be created or foregrounded, returning the process | 71 // the renderer process to be created or foregrounded, returning the process |
72 // handle. | 72 // handle. |
73 base::ProcessHandle ShowSingletonTab(const GURL& page) { | 73 base::ProcessHandle ShowSingletonTab(const GURL& page) { |
74 chrome::ShowSingletonTab(browser(), page); | 74 chrome::ShowSingletonTab(browser(), page); |
75 WebContents* wc = browser()->tab_strip_model()->GetActiveWebContents(); | 75 WebContents* wc = browser()->tab_strip_model()->GetActiveWebContents(); |
76 CHECK(wc->GetURL() == page); | 76 CHECK(wc->GetURL() == page); |
77 | 77 |
78 // Ensure that the backgrounding / foregrounding gets a chance to run. | 78 // Ensure that the backgrounding / foregrounding gets a chance to run. |
79 content::BrowserThread::PostTaskAndReply( | 79 content::BrowserThread::PostTaskAndReply( |
80 content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE, | 80 content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE, |
81 base::Bind(&base::DoNothing), MessageLoop::QuitClosure()); | 81 base::Bind(&base::DoNothing), base::MessageLoop::QuitClosure()); |
82 MessageLoop::current()->Run(); | 82 base::MessageLoop::current()->Run(); |
83 | 83 |
84 return wc->GetRenderProcessHost()->GetHandle(); | 84 return wc->GetRenderProcessHost()->GetHandle(); |
85 } | 85 } |
86 | 86 |
87 // When we hit the max number of renderers, verify that the way we do process | 87 // When we hit the max number of renderers, verify that the way we do process |
88 // sharing behaves correctly. In particular, this test is verifying that even | 88 // sharing behaves correctly. In particular, this test is verifying that even |
89 // when we hit the max process limit, that renderers of each type will wind up | 89 // when we hit the max process limit, that renderers of each type will wind up |
90 // in a process of that type, even if that means creating a new process. | 90 // in a process of that type, even if that means creating a new process. |
91 void TestProcessOverflow() { | 91 void TestProcessOverflow() { |
92 int tab_count = 1; | 92 int tab_count = 1; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 RenderViewHost* devtools = FindFirstDevToolsHost(); | 355 RenderViewHost* devtools = FindFirstDevToolsHost(); |
356 DCHECK(devtools); | 356 DCHECK(devtools); |
357 | 357 |
358 // DevTools start in a separate process. | 358 // DevTools start in a separate process. |
359 DevToolsWindow::ToggleDevToolsWindow( | 359 DevToolsWindow::ToggleDevToolsWindow( |
360 devtools, true, DEVTOOLS_TOGGLE_ACTION_INSPECT); | 360 devtools, true, DEVTOOLS_TOGGLE_ACTION_INSPECT); |
361 host_count++; | 361 host_count++; |
362 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 362 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
363 EXPECT_EQ(host_count, RenderProcessHostCount()); | 363 EXPECT_EQ(host_count, RenderProcessHostCount()); |
364 } | 364 } |
OLD | NEW |