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 #if defined(OS_POSIX) | 5 #if defined(OS_POSIX) |
6 #include <signal.h> | 6 #include <signal.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 422 } |
423 | 423 |
424 class FastUnloadTest : public UnloadTest { | 424 class FastUnloadTest : public UnloadTest { |
425 public: | 425 public: |
426 void SetUpCommandLine(base::CommandLine* command_line) override { | 426 void SetUpCommandLine(base::CommandLine* command_line) override { |
427 UnloadTest::SetUpCommandLine(command_line); | 427 UnloadTest::SetUpCommandLine(command_line); |
428 command_line->AppendSwitch(switches::kEnableFastUnload); | 428 command_line->AppendSwitch(switches::kEnableFastUnload); |
429 } | 429 } |
430 | 430 |
431 void SetUpInProcessBrowserTestFixture() override { | 431 void SetUpInProcessBrowserTestFixture() override { |
432 ASSERT_TRUE(test_server()->Start()); | 432 ASSERT_TRUE(embedded_test_server()->Start()); |
433 } | 433 } |
434 | 434 |
435 void TearDownInProcessBrowserTestFixture() override { test_server()->Stop(); } | |
436 | |
437 GURL GetUrl(const std::string& name) { | 435 GURL GetUrl(const std::string& name) { |
438 return GURL(test_server()->GetURL( | 436 return GURL( |
439 "files/fast_tab_close/" + name + ".html")); | 437 embedded_test_server()->GetURL("/fast_tab_close/" + name + ".html")); |
440 } | 438 } |
441 | 439 |
442 void NavigateToPage(const char* name) { | 440 void NavigateToPage(const char* name) { |
443 ui_test_utils::NavigateToURL(browser(), GetUrl(name)); | 441 ui_test_utils::NavigateToURL(browser(), GetUrl(name)); |
444 CheckTitle(name); | 442 CheckTitle(name); |
445 } | 443 } |
446 | 444 |
447 void NavigateToPageInNewTab(const char* name) { | 445 void NavigateToPageInNewTab(const char* name) { |
448 ui_test_utils::NavigateToURLWithDisposition( | 446 ui_test_utils::NavigateToURLWithDisposition( |
449 browser(), GetUrl(name), NEW_FOREGROUND_TAB, | 447 browser(), GetUrl(name), NEW_FOREGROUND_TAB, |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 content::WindowedNotificationObserver window_observer( | 636 content::WindowedNotificationObserver window_observer( |
639 chrome::NOTIFICATION_BROWSER_CLOSED, | 637 chrome::NOTIFICATION_BROWSER_CLOSED, |
640 content::NotificationService::AllSources()); | 638 content::NotificationService::AllSources()); |
641 chrome::CloseWindow(browser()); | 639 chrome::CloseWindow(browser()); |
642 CrashTab(beforeunload_contents); | 640 CrashTab(beforeunload_contents); |
643 window_observer.Wait(); | 641 window_observer.Wait(); |
644 } | 642 } |
645 | 643 |
646 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 644 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
647 // and multiple windows. | 645 // and multiple windows. |
OLD | NEW |