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

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc

Issue 10807047: Create content\public\test\test_utils.h to hold common test classes that are used by unit and brows… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/browser_commands.h" 7 #include "chrome/browser/ui/browser_commands.h"
8 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 ui_test_utils::NavigateToURLWithDisposition( 52 ui_test_utils::NavigateToURLWithDisposition(
53 browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB, 53 browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB,
54 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 54 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
55 EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 1)->GetMaxPageID()); 55 EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 1)->GetMaxPageID());
56 56
57 // Navigate that tab to another site. This allows the NTP process to exit, 57 // Navigate that tab to another site. This allows the NTP process to exit,
58 // but it keeps the NTP SiteInstance (and its max_page_id) alive in history. 58 // but it keeps the NTP SiteInstance (and its max_page_id) alive in history.
59 { 59 {
60 // Wait not just for the navigation to finish, but for the NTP process to 60 // Wait not just for the navigation to finish, but for the NTP process to
61 // exit as well. 61 // exit as well.
62 ui_test_utils::WindowedNotificationObserver process_exited_observer( 62 content::WindowedNotificationObserver process_exited_observer(
63 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 63 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
64 content::NotificationService::AllSources()); 64 content::NotificationService::AllSources());
65 browser()->OpenURL(OpenURLParams( 65 browser()->OpenURL(OpenURLParams(
66 test_server()->GetURL("files/title1.html"), Referrer(), CURRENT_TAB, 66 test_server()->GetURL("files/title1.html"), Referrer(), CURRENT_TAB,
67 content::PAGE_TRANSITION_TYPED, false)); 67 content::PAGE_TRANSITION_TYPED, false));
68 process_exited_observer.Wait(); 68 process_exited_observer.Wait();
69 } 69 }
70 70
71 // Creating a NTP in another tab should not be affected, since page IDs 71 // Creating a NTP in another tab should not be affected, since page IDs
72 // are now specific to a tab. 72 // are now specific to a tab.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 // We don't use ui_test_utils::NavigateToURLWithDisposition because that waits 145 // We don't use ui_test_utils::NavigateToURLWithDisposition because that waits
146 // for current loading to stop. 146 // for current loading to stop.
147 content::TestNavigationObserver observer( 147 content::TestNavigationObserver observer(
148 content::NotificationService::AllSources()); 148 content::NotificationService::AllSources());
149 browser()->OpenURL(OpenURLParams( 149 browser()->OpenURL(OpenURLParams(
150 GURL("data:text/html,hello world"), Referrer(), CURRENT_TAB, 150 GURL("data:text/html,hello world"), Referrer(), CURRENT_TAB,
151 content::PAGE_TRANSITION_TYPED, false)); 151 content::PAGE_TRANSITION_TYPED, false));
152 observer.Wait(); 152 observer.Wait();
153 } 153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698