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 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 #elif defined(OS_CHROMEOS) | 2128 #elif defined(OS_CHROMEOS) |
2129 // TODO(jamescook): If immersive fullscreen is disabled by default, test | 2129 // TODO(jamescook): If immersive fullscreen is disabled by default, test |
2130 // for BookmarkBar::HIDDEN. | 2130 // for BookmarkBar::HIDDEN. |
2131 EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state()); | 2131 EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state()); |
2132 #else | 2132 #else |
2133 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); | 2133 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); |
2134 #endif | 2134 #endif |
2135 } | 2135 } |
2136 #endif | 2136 #endif |
2137 | 2137 |
2138 class ShowModalDialogTest : public BrowserTest { | |
2139 public: | |
2140 ShowModalDialogTest() {} | |
2141 | |
2142 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
2143 command_line->AppendSwitch(switches::kDisablePopupBlocking); | |
2144 } | |
2145 }; | |
2146 | |
2147 IN_PROC_BROWSER_TEST_F(ShowModalDialogTest, BasicTest) { | |
2148 // This navigation should show a modal dialog that will be immediately | |
2149 // closed, but the fact that it was shown should be recorded. | |
2150 GURL url = ui_test_utils::GetTestUrl( | |
2151 base::FilePath(), base::FilePath().AppendASCII("showmodaldialog.html")); | |
2152 | |
2153 base::string16 expected_title(ASCIIToUTF16("SUCCESS")); | |
2154 content::TitleWatcher title_watcher( | |
2155 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); | |
2156 ui_test_utils::NavigateToURL(browser(), url); | |
2157 | |
2158 // Verify that we set a mark on successful dialog show. | |
2159 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | |
2160 } | |
2161 | |
2162 IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) { | 2138 IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) { |
2163 GURL url = ui_test_utils::GetTestUrl( | 2139 GURL url = ui_test_utils::GetTestUrl( |
2164 base::FilePath(), | 2140 base::FilePath(), |
2165 base::FilePath().AppendASCII("fileurl_universalaccess.html")); | 2141 base::FilePath().AppendASCII("fileurl_universalaccess.html")); |
2166 | 2142 |
2167 base::string16 expected_title(ASCIIToUTF16("Disallowed")); | 2143 base::string16 expected_title(ASCIIToUTF16("Disallowed")); |
2168 content::TitleWatcher title_watcher( | 2144 content::TitleWatcher title_watcher( |
2169 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); | 2145 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); |
2170 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); | 2146 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); |
2171 ui_test_utils::NavigateToURL(browser(), url); | 2147 ui_test_utils::NavigateToURL(browser(), url); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2699 #endif | 2675 #endif |
2700 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2676 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2701 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2677 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2702 gfx::Size exp_final_size(initial_wcv_size); | 2678 gfx::Size exp_final_size(initial_wcv_size); |
2703 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2679 exp_final_size.Enlarge(wcv_resize_insets.width(), |
2704 wcv_resize_insets.height() + height_inset); | 2680 wcv_resize_insets.height() + height_inset); |
2705 EXPECT_EQ(exp_final_size, | 2681 EXPECT_EQ(exp_final_size, |
2706 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2682 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2707 EXPECT_EQ(exp_final_size, web_contents->GetView()->GetContainerSize()); | 2683 EXPECT_EQ(exp_final_size, web_contents->GetView()->GetContainerSize()); |
2708 } | 2684 } |
OLD | NEW |