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

Side by Side Diff: chrome/browser/browser_browsertest.cc

Issue 2881028: GTTF: test server cleanup: (Closed)
Patch Set: final Created 10 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
« no previous file with comments | « no previous file | chrome/browser/browser_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <string> 5 #include <string>
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 FilePath(kEmptyFile))); 323 FilePath(kEmptyFile)));
324 ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme)); 324 ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme));
325 ui_test_utils::NavigateToURL(browser(), file_url); 325 ui_test_utils::NavigateToURL(browser(), file_url);
326 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 326 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
327 } 327 }
328 328
329 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { 329 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) {
330 CommandUpdater* command_updater = browser()->command_updater(); 330 CommandUpdater* command_updater = browser()->command_updater();
331 331
332 scoped_refptr<HTTPTestServer> http_server( 332 scoped_refptr<HTTPTestServer> http_server(
333 HTTPTestServer::CreateServer(kDocRoot, NULL)); 333 HTTPTestServer::CreateServer(kDocRoot));
334 ASSERT_TRUE(NULL != http_server.get()); 334 ASSERT_TRUE(NULL != http_server.get());
335 GURL http_url(http_server->TestServerPage("")); 335 GURL http_url(http_server->TestServerPage(""));
336 ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme)); 336 ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme));
337 ui_test_utils::NavigateToURL(browser(), http_url); 337 ui_test_utils::NavigateToURL(browser(), http_url);
338 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 338 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
339 } 339 }
340 340
341 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttps) { 341 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttps) {
342 CommandUpdater* command_updater = browser()->command_updater(); 342 CommandUpdater* command_updater = browser()->command_updater();
343 343
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 ui_test_utils::NavigateToURL(browser(), blank_url); 382 ui_test_utils::NavigateToURL(browser(), blank_url);
383 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 383 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
384 } 384 }
385 #endif // !defined(OS_MACOSX) 385 #endif // !defined(OS_MACOSX)
386 386
387 // Test RenderView correctly send back favicon url for web page that redirects 387 // Test RenderView correctly send back favicon url for web page that redirects
388 // to an anchor in javascript body.onload handler. 388 // to an anchor in javascript body.onload handler.
389 IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconOfOnloadRedirectToAnchorPage) { 389 IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconOfOnloadRedirectToAnchorPage) {
390 static const wchar_t kDocRoot[] = L"chrome/test/data"; 390 static const wchar_t kDocRoot[] = L"chrome/test/data";
391 scoped_refptr<HTTPTestServer> server( 391 scoped_refptr<HTTPTestServer> server(
392 HTTPTestServer::CreateServer(kDocRoot, NULL)); 392 HTTPTestServer::CreateServer(kDocRoot));
393 ASSERT_TRUE(NULL != server.get()); 393 ASSERT_TRUE(NULL != server.get());
394 GURL url(server->TestServerPage("files/onload_redirect_to_anchor.html")); 394 GURL url(server->TestServerPage("files/onload_redirect_to_anchor.html"));
395 GURL expected_favicon_url(server->TestServerPage("files/test.png")); 395 GURL expected_favicon_url(server->TestServerPage("files/test.png"));
396 396
397 ui_test_utils::NavigateToURL(browser(), url); 397 ui_test_utils::NavigateToURL(browser(), url);
398 398
399 NavigationEntry* entry = browser()->GetSelectedTabContents()-> 399 NavigationEntry* entry = browser()->GetSelectedTabContents()->
400 controller().GetActiveEntry(); 400 controller().GetActiveEntry();
401 EXPECT_EQ(expected_favicon_url.spec(), entry->favicon().url().spec()); 401 EXPECT_EQ(expected_favicon_url.spec(), entry->favicon().url().spec());
402 } 402 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 #if defined(OS_WIN) 503 #if defined(OS_WIN)
504 // http://crbug.com/46198. On XP/Vista, the failure rate is 5 ~ 6%. 504 // http://crbug.com/46198. On XP/Vista, the failure rate is 5 ~ 6%.
505 #define MAYBE_PageLanguageDetection FLAKY_PageLanguageDetection 505 #define MAYBE_PageLanguageDetection FLAKY_PageLanguageDetection
506 #else 506 #else
507 #define MAYBE_PageLanguageDetection PageLanguageDetection 507 #define MAYBE_PageLanguageDetection PageLanguageDetection
508 #endif 508 #endif
509 // Tests that the CLD (Compact Language Detection) works properly. 509 // Tests that the CLD (Compact Language Detection) works properly.
510 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageLanguageDetection) { 510 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageLanguageDetection) {
511 static const wchar_t kDocRoot[] = L"chrome/test/data"; 511 static const wchar_t kDocRoot[] = L"chrome/test/data";
512 scoped_refptr<HTTPTestServer> server( 512 scoped_refptr<HTTPTestServer> server(
513 HTTPTestServer::CreateServer(kDocRoot, NULL)); 513 HTTPTestServer::CreateServer(kDocRoot));
514 ASSERT_TRUE(NULL != server.get()); 514 ASSERT_TRUE(NULL != server.get());
515 515
516 TabContents* current_tab = browser()->GetSelectedTabContents(); 516 TabContents* current_tab = browser()->GetSelectedTabContents();
517 517
518 // Navigate to a page in English. 518 // Navigate to a page in English.
519 ui_test_utils::WindowedNotificationObserverWithDetails<TabContents, 519 ui_test_utils::WindowedNotificationObserverWithDetails<TabContents,
520 std::string> 520 std::string>
521 en_language_detected_signal(NotificationType::TAB_LANGUAGE_DETERMINED, 521 en_language_detected_signal(NotificationType::TAB_LANGUAGE_DETERMINED,
522 current_tab); 522 current_tab);
523 ui_test_utils::NavigateToURL( 523 ui_test_utils::NavigateToURL(
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 982
983 // The normal browser should now have four. 983 // The normal browser should now have four.
984 EXPECT_EQ(4, browser()->tab_count()); 984 EXPECT_EQ(4, browser()->tab_count());
985 985
986 // Close the additional browsers. 986 // Close the additional browsers.
987 popup_browser->CloseAllTabs(); 987 popup_browser->CloseAllTabs();
988 app_browser->CloseAllTabs(); 988 app_browser->CloseAllTabs();
989 app_popup_browser->CloseAllTabs(); 989 app_popup_browser->CloseAllTabs();
990 } 990 }
991 #endif 991 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698