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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 } | 847 } |
848 | 848 |
849 // BeforeUnloadAtQuitWithTwoWindows is a regression test for | 849 // BeforeUnloadAtQuitWithTwoWindows is a regression test for |
850 // http://crbug.com/11842. It opens two windows, one of which has a | 850 // http://crbug.com/11842. It opens two windows, one of which has a |
851 // beforeunload handler and attempts to exit cleanly. | 851 // beforeunload handler and attempts to exit cleanly. |
852 class BeforeUnloadAtQuitWithTwoWindows : public InProcessBrowserTest { | 852 class BeforeUnloadAtQuitWithTwoWindows : public InProcessBrowserTest { |
853 public: | 853 public: |
854 // This test is for testing a specific shutdown behavior. This mimics what | 854 // This test is for testing a specific shutdown behavior. This mimics what |
855 // happens in InProcessBrowserTest::RunTestOnMainThread and QuitBrowsers, but | 855 // happens in InProcessBrowserTest::RunTestOnMainThread and QuitBrowsers, but |
856 // ensures that it happens through the single IDC_EXIT of the test. | 856 // ensures that it happens through the single IDC_EXIT of the test. |
857 virtual void CleanUpOnMainThread() OVERRIDE { | 857 virtual void TearDownOnMainThread() OVERRIDE { |
858 // Cycle both the MessageLoop and the Cocoa runloop twice to flush out any | 858 // Cycle both the MessageLoop and the Cocoa runloop twice to flush out any |
859 // Chrome work that generates Cocoa work. Do this twice since there are two | 859 // Chrome work that generates Cocoa work. Do this twice since there are two |
860 // Browsers that must be closed. | 860 // Browsers that must be closed. |
861 CycleRunLoops(); | 861 CycleRunLoops(); |
862 CycleRunLoops(); | 862 CycleRunLoops(); |
863 | 863 |
864 // Run the application event loop to completion, which will cycle the | 864 // Run the application event loop to completion, which will cycle the |
865 // native MessagePump on all platforms. | 865 // native MessagePump on all platforms. |
866 base::MessageLoop::current()->PostTask(FROM_HERE, | 866 base::MessageLoop::current()->PostTask(FROM_HERE, |
867 base::MessageLoop::QuitClosure()); | 867 base::MessageLoop::QuitClosure()); |
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 #endif | 2707 #endif |
2708 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2708 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2709 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2709 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2710 gfx::Size exp_final_size(initial_wcv_size); | 2710 gfx::Size exp_final_size(initial_wcv_size); |
2711 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2711 exp_final_size.Enlarge(wcv_resize_insets.width(), |
2712 wcv_resize_insets.height() + height_inset); | 2712 wcv_resize_insets.height() + height_inset); |
2713 EXPECT_EQ(exp_final_size, | 2713 EXPECT_EQ(exp_final_size, |
2714 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2714 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2715 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2715 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
2716 } | 2716 } |
OLD | NEW |