| 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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 #elif defined(OS_CHROMEOS) | 2011 #elif defined(OS_CHROMEOS) |
| 2012 // TODO(jamescook): If immersive fullscreen is disabled by default, test | 2012 // TODO(jamescook): If immersive fullscreen is disabled by default, test |
| 2013 // for BookmarkBar::HIDDEN. | 2013 // for BookmarkBar::HIDDEN. |
| 2014 EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state()); | 2014 EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state()); |
| 2015 #else | 2015 #else |
| 2016 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); | 2016 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); |
| 2017 #endif | 2017 #endif |
| 2018 } | 2018 } |
| 2019 #endif | 2019 #endif |
| 2020 | 2020 |
| 2021 class ShowModalDialogTest : public BrowserTest { | |
| 2022 public: | |
| 2023 ShowModalDialogTest() {} | |
| 2024 | |
| 2025 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 2026 command_line->AppendSwitch(switches::kDisablePopupBlocking); | |
| 2027 } | |
| 2028 }; | |
| 2029 | |
| 2030 IN_PROC_BROWSER_TEST_F(ShowModalDialogTest, BasicTest) { | |
| 2031 // This navigation should show a modal dialog that will be immediately | |
| 2032 // closed, but the fact that it was shown should be recorded. | |
| 2033 GURL url = ui_test_utils::GetTestUrl( | |
| 2034 base::FilePath(), base::FilePath().AppendASCII("showmodaldialog.html")); | |
| 2035 | |
| 2036 base::string16 expected_title(ASCIIToUTF16("SUCCESS")); | |
| 2037 content::TitleWatcher title_watcher( | |
| 2038 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); | |
| 2039 ui_test_utils::NavigateToURL(browser(), url); | |
| 2040 | |
| 2041 // Verify that we set a mark on successful dialog show. | |
| 2042 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | |
| 2043 } | |
| 2044 | |
| 2045 IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) { | 2021 IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) { |
| 2046 GURL url = ui_test_utils::GetTestUrl( | 2022 GURL url = ui_test_utils::GetTestUrl( |
| 2047 base::FilePath(), | 2023 base::FilePath(), |
| 2048 base::FilePath().AppendASCII("fileurl_universalaccess.html")); | 2024 base::FilePath().AppendASCII("fileurl_universalaccess.html")); |
| 2049 | 2025 |
| 2050 base::string16 expected_title(ASCIIToUTF16("Disallowed")); | 2026 base::string16 expected_title(ASCIIToUTF16("Disallowed")); |
| 2051 content::TitleWatcher title_watcher( | 2027 content::TitleWatcher title_watcher( |
| 2052 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); | 2028 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); |
| 2053 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); | 2029 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); |
| 2054 ui_test_utils::NavigateToURL(browser(), url); | 2030 ui_test_utils::NavigateToURL(browser(), url); |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2556 exp_commit_size.Enlarge(wcv_resize_insets.width(), | 2532 exp_commit_size.Enlarge(wcv_resize_insets.width(), |
| 2557 wcv_resize_insets.height() + height_inset); | 2533 wcv_resize_insets.height() + height_inset); |
| 2558 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2534 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
| 2559 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2535 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
| 2560 // Sizes of RenderWidgetHostView and WebContentsView before and after | 2536 // Sizes of RenderWidgetHostView and WebContentsView before and after |
| 2561 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. | 2537 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. |
| 2562 EXPECT_EQ(rwhv_commit_size2, | 2538 EXPECT_EQ(rwhv_commit_size2, |
| 2563 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2539 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
| 2564 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); | 2540 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); |
| 2565 } | 2541 } |
| OLD | NEW |