| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 406 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 407 content::NotificationService::AllSources()); | 407 content::NotificationService::AllSources()); |
| 408 chrome::CloseTab(browser()); | 408 chrome::CloseTab(browser()); |
| 409 tab_close_observer.Wait(); | 409 tab_close_observer.Wait(); |
| 410 | 410 |
| 411 CheckTitle("only_one_unload"); | 411 CheckTitle("only_one_unload"); |
| 412 } | 412 } |
| 413 | 413 |
| 414 class FastUnloadTest : public UnloadTest { | 414 class FastUnloadTest : public UnloadTest { |
| 415 public: | 415 public: |
| 416 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 417 UnloadTest::SetUpCommandLine(command_line); |
| 418 command_line->AppendSwitch(switches::kEnableFastUnload); |
| 419 } |
| 420 |
| 416 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 421 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 417 ASSERT_TRUE(test_server()->Start()); | 422 ASSERT_TRUE(test_server()->Start()); |
| 418 } | 423 } |
| 419 | 424 |
| 420 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 425 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 421 test_server()->Stop(); | 426 test_server()->Stop(); |
| 422 } | 427 } |
| 423 | 428 |
| 424 GURL GetUrl(const std::string& name) { | 429 GURL GetUrl(const std::string& name) { |
| 425 return GURL(test_server()->GetURL( | 430 return GURL(test_server()->GetURL( |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 content::WindowedNotificationObserver window_observer( | 615 content::WindowedNotificationObserver window_observer( |
| 611 chrome::NOTIFICATION_BROWSER_CLOSED, | 616 chrome::NOTIFICATION_BROWSER_CLOSED, |
| 612 content::NotificationService::AllSources()); | 617 content::NotificationService::AllSources()); |
| 613 chrome::CloseWindow(browser()); | 618 chrome::CloseWindow(browser()); |
| 614 CrashTab(beforeunload_contents); | 619 CrashTab(beforeunload_contents); |
| 615 window_observer.Wait(); | 620 window_observer.Wait(); |
| 616 } | 621 } |
| 617 | 622 |
| 618 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 623 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
| 619 // and multiple windows. | 624 // and multiple windows. |
| OLD | NEW |