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