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

Side by Side Diff: trunk/src/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc

Issue 23475011: Revert 220623 "Update chrome://newtab checks in browser tests to..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/chrome_notification_types.h" 6 #include "chrome/browser/chrome_notification_types.h"
7 #include "chrome/browser/devtools/devtools_window.h" 7 #include "chrome/browser/devtools/devtools_window.h"
8 #include "chrome/browser/search/search.h"
9 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
11 #include "chrome/browser/ui/singleton_tabs.h" 10 #include "chrome/browser/ui/singleton_tabs.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" 11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/url_constants.h" 13 #include "chrome/common/url_constants.h"
15 #include "chrome/test/base/in_process_browser_test.h" 14 #include "chrome/test/base/in_process_browser_test.h"
16 #include "chrome/test/base/test_switches.h" 15 #include "chrome/test/base/test_switches.h"
17 #include "chrome/test/base/ui_test_utils.h" 16 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/browser/notification_service.h" 17 #include "content/public/browser/notification_service.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 content::RenderProcessHost* rph1 = NULL; 89 content::RenderProcessHost* rph1 = NULL;
91 content::RenderProcessHost* rph2 = NULL; 90 content::RenderProcessHost* rph2 = NULL;
92 content::RenderProcessHost* rph3 = NULL; 91 content::RenderProcessHost* rph3 = NULL;
93 92
94 // Change the first tab to be the new tab page (TYPE_WEBUI). 93 // Change the first tab to be the new tab page (TYPE_WEBUI).
95 GURL newtab(chrome::kChromeUINewTabURL); 94 GURL newtab(chrome::kChromeUINewTabURL);
96 ui_test_utils::NavigateToURL(browser(), newtab); 95 ui_test_utils::NavigateToURL(browser(), newtab);
97 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); 96 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count());
98 tab1 = browser()->tab_strip_model()->GetWebContentsAt(tab_count - 1); 97 tab1 = browser()->tab_strip_model()->GetWebContentsAt(tab_count - 1);
99 rph1 = tab1->GetRenderProcessHost(); 98 rph1 = tab1->GetRenderProcessHost();
100 EXPECT_TRUE(chrome::IsNTPURL(tab1->GetURL(), browser()->profile())); 99 EXPECT_EQ(tab1->GetURL(), newtab);
101 EXPECT_EQ(host_count, RenderProcessHostCount()); 100 EXPECT_EQ(host_count, RenderProcessHostCount());
102 101
103 // Create a new TYPE_TABBED tab. It should be in its own process. 102 // Create a new TYPE_TABBED tab. It should be in its own process.
104 GURL page1("data:text/html,hello world1"); 103 GURL page1("data:text/html,hello world1");
105 104
106 ui_test_utils::WindowedTabAddedNotificationObserver observer1( 105 ui_test_utils::WindowedTabAddedNotificationObserver observer1(
107 content::NotificationService::AllSources()); 106 content::NotificationService::AllSources());
108 chrome::ShowSingletonTab(browser(), page1); 107 chrome::ShowSingletonTab(browser(), page1);
109 observer1.Wait(); 108 observer1.Wait();
110 109
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 chrome::NOTIFICATION_BROWSER_CLOSED, 423 chrome::NOTIFICATION_BROWSER_CLOSED,
425 content::NotificationService::AllSources()); 424 content::NotificationService::AllSources());
426 425
427 // Kill the renderer process, simulating a crash. This should the ProcessDied 426 // Kill the renderer process, simulating a crash. This should the ProcessDied
428 // method to be called. Alternatively, RenderProcessHost::OnChannelError can 427 // method to be called. Alternatively, RenderProcessHost::OnChannelError can
429 // be called to directly force a call to ProcessDied. 428 // be called to directly force a call to ProcessDied.
430 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); 429 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true);
431 430
432 observer.Wait(); 431 observer.Wait();
433 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698