Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 201153003: Revert 252883 "Remove tests and code for showModalDialog" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/showmodaldialog.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 #elif defined(OS_CHROMEOS) 2033 #elif defined(OS_CHROMEOS)
2034 // TODO(jamescook): If immersive fullscreen is disabled by default, test 2034 // TODO(jamescook): If immersive fullscreen is disabled by default, test
2035 // for BookmarkBar::HIDDEN. 2035 // for BookmarkBar::HIDDEN.
2036 EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state()); 2036 EXPECT_EQ(BookmarkBar::SHOW, browser()->bookmark_bar_state());
2037 #else 2037 #else
2038 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); 2038 EXPECT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state());
2039 #endif 2039 #endif
2040 } 2040 }
2041 #endif 2041 #endif
2042 2042
2043 class ShowModalDialogTest : public BrowserTest {
2044 public:
2045 ShowModalDialogTest() {}
2046
2047 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
2048 command_line->AppendSwitch(switches::kDisablePopupBlocking);
2049 }
2050 };
2051
2052 IN_PROC_BROWSER_TEST_F(ShowModalDialogTest, BasicTest) {
2053 // This navigation should show a modal dialog that will be immediately
2054 // closed, but the fact that it was shown should be recorded.
2055 GURL url = ui_test_utils::GetTestUrl(
2056 base::FilePath(), base::FilePath().AppendASCII("showmodaldialog.html"));
2057
2058 base::string16 expected_title(ASCIIToUTF16("SUCCESS"));
2059 content::TitleWatcher title_watcher(
2060 browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
2061 ui_test_utils::NavigateToURL(browser(), url);
2062
2063 // Verify that we set a mark on successful dialog show.
2064 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
2065 }
2066
2043 IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) { 2067 IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) {
2044 GURL url = ui_test_utils::GetTestUrl( 2068 GURL url = ui_test_utils::GetTestUrl(
2045 base::FilePath(), 2069 base::FilePath(),
2046 base::FilePath().AppendASCII("fileurl_universalaccess.html")); 2070 base::FilePath().AppendASCII("fileurl_universalaccess.html"));
2047 2071
2048 base::string16 expected_title(ASCIIToUTF16("Disallowed")); 2072 base::string16 expected_title(ASCIIToUTF16("Disallowed"));
2049 content::TitleWatcher title_watcher( 2073 content::TitleWatcher title_watcher(
2050 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); 2074 browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
2051 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); 2075 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed"));
2052 ui_test_utils::NavigateToURL(browser(), url); 2076 ui_test_utils::NavigateToURL(browser(), url);
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 #endif 2604 #endif
2581 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2605 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2582 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2606 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2583 gfx::Size exp_final_size(initial_wcv_size); 2607 gfx::Size exp_final_size(initial_wcv_size);
2584 exp_final_size.Enlarge(wcv_resize_insets.width(), 2608 exp_final_size.Enlarge(wcv_resize_insets.width(),
2585 wcv_resize_insets.height() + height_inset); 2609 wcv_resize_insets.height() + height_inset);
2586 EXPECT_EQ(exp_final_size, 2610 EXPECT_EQ(exp_final_size,
2587 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2611 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2588 EXPECT_EQ(exp_final_size, web_contents->GetView()->GetContainerSize()); 2612 EXPECT_EQ(exp_final_size, web_contents->GetView()->GetContainerSize());
2589 } 2613 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/showmodaldialog.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698