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

Unified Diff: chrome/browser/ui/browser_focus_uitest.cc

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_focus_uitest.cc
diff --git a/chrome/browser/ui/browser_focus_uitest.cc b/chrome/browser/ui/browser_focus_uitest.cc
index e83c347929379821ba25b5305d8299e46f116d7b..303d4c250a2ea8ae851e6ce07abc93b971d917ee 100644
--- a/chrome/browser/ui/browser_focus_uitest.cc
+++ b/chrome/browser/ui/browser_focus_uitest.cc
@@ -37,7 +37,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/test/browser_test_utils.h"
-#include "net/test/spawned_test_server/spawned_test_server.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
#if defined(TOOLKIT_VIEWS)
#include "chrome/browser/ui/views/frame/browser_view.h"
@@ -87,9 +87,9 @@ const int kActionDelayMs = 500;
// Maxiumum time to wait until the focus is moved to expected view.
const int kFocusChangeTimeoutMs = 500;
-const char kSimplePage[] = "files/focus/page_with_focus.html";
-const char kStealFocusPage[] = "files/focus/page_steals_focus.html";
-const char kTypicalPage[] = "files/focus/typical_page.html";
+const char kSimplePage[] = "/focus/page_with_focus.html";
+const char kStealFocusPage[] = "/focus/page_steals_focus.html";
+const char kTypicalPage[] = "/focus/typical_page.html";
const char kTypicalPageName[] = "typical_page.html";
// Test to make sure Chrome is in the foreground as we start testing. This is
@@ -238,10 +238,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) {
// Flaky, http://crbug.com/69034.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_BrowsersRememberFocus) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// First we navigate to our test page.
- GURL url = test_server()->GetURL(kSimplePage);
+ GURL url = embedded_test_server()->GetURL(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
gfx::NativeWindow window = browser()->window()->GetNativeWindow();
@@ -307,10 +307,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_BrowsersRememberFocus) {
// Disabled, http://crbug.com/62542.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabsRememberFocus) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// First we navigate to our test page.
- GURL url = test_server()->GetURL(kSimplePage);
+ GURL url = embedded_test_server()->GetURL(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
// Create several tabs.
@@ -376,10 +376,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabsRememberFocus) {
// Tabs remember focus with find-in-page box.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// First we navigate to our test page.
- GURL url = test_server()->GetURL(kSimplePage);
+ GURL url = embedded_test_server()->GetURL(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
chrome::Find(browser());
@@ -417,7 +417,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) {
IN_PROC_BROWSER_TEST_F(BrowserFocusTest,
DISABLED_BackgroundBrowserDontStealFocus) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// Open a new browser window.
Browser* browser2 =
@@ -450,7 +450,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest,
unfocused_browser = browser();
#endif
- GURL steal_focus_url = test_server()->GetURL(kStealFocusPage);
+ GURL steal_focus_url = embedded_test_server()->GetURL(kStealFocusPage);
ui_test_utils::NavigateToURL(unfocused_browser, steal_focus_url);
// Activate the first browser.
@@ -467,10 +467,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest,
// Page cannot steal focus when focus is on location bar.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// Open the page that steals focus.
- GURL url = test_server()->GetURL(kStealFocusPage);
+ GURL url = embedded_test_server()->GetURL(kStealFocusPage);
ui_test_utils::NavigateToURL(browser(), url);
chrome::FocusLocationBar(browser());
@@ -490,10 +490,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) {
// RenderWidget::didFocus()).
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// First we navigate to our test page.
- GURL url = test_server()->GetURL(kTypicalPage);
+ GURL url = embedded_test_server()->GetURL(kTypicalPage);
ui_test_utils::NavigateToURL(browser(), url);
chrome::FocusLocationBar(browser());
@@ -612,10 +612,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
// Focus traversal while an interstitial is showing.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// First we navigate to our test page.
- GURL url = test_server()->GetURL(kSimplePage);
+ GURL url = embedded_test_server()->GetURL(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
// Focus should be on the page.
@@ -732,10 +732,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) {
// http://crbug.com/81451
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_InterstitialFocus) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// First we navigate to our test page.
- GURL url = test_server()->GetURL(kSimplePage);
+ GURL url = embedded_test_server()->GetURL(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
// Page should have focus.
@@ -769,10 +769,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_InterstitialFocus) {
// Disabled due to flakiness. http://crbug.com/67301.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FindFocusTest) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// Open some page (any page that doesn't steal focus).
- GURL url = test_server()->GetURL(kTypicalPage);
+ GURL url = embedded_test_server()->GetURL(kTypicalPage);
ui_test_utils::NavigateToURL(browser(), url);
EXPECT_TRUE(ChromeInForeground());
@@ -853,7 +853,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabInitialFocus) {
// Tests that focus goes where expected when using reload.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// Open the new tab, reload.
{
@@ -878,7 +878,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX));
// Open a regular page, focus the location bar, reload.
- ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(kSimplePage));
+ ui_test_utils::NavigateToURL(browser(),
+ embedded_test_server()->GetURL(kSimplePage));
chrome::FocusLocationBar(browser());
ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX));
{
@@ -899,10 +900,11 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
// Tests that focus goes where expected when using reload on a crashed tab.
IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnReloadCrashedTab) {
ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
- ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
// Open a regular page, crash, reload.
- ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(kSimplePage));
+ ui_test_utils::NavigateToURL(browser(),
+ embedded_test_server()->GetURL(kSimplePage));
content::CrashTab(browser()->tab_strip_model()->GetActiveWebContents());
{
content::WindowedNotificationObserver observer(

Powered by Google App Engine
This is Rietveld 408576698