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

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

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test exclusion. Created 7 years, 2 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
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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 ui_test_utils::NavigateToURL(browser(), ftp_url); 1004 ui_test_utils::NavigateToURL(browser(), ftp_url);
1005 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 1005 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
1006 } 1006 }
1007 1007
1008 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { 1008 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) {
1009 CommandUpdater* command_updater = 1009 CommandUpdater* command_updater =
1010 browser()->command_controller()->command_updater(); 1010 browser()->command_controller()->command_updater();
1011 1011
1012 // Urls that should not have shortcuts. 1012 // Urls that should not have shortcuts.
1013 GURL new_tab_url(chrome::kChromeUINewTabURL); 1013 GURL new_tab_url(chrome::kChromeUINewTabURL);
1014 ui_test_utils::NavigateToURL(browser(), new_tab_url); 1014 ui_test_utils::NavigateToURLWithDisposition(
1015 browser(), new_tab_url, CURRENT_TAB, ui_test_utils::BROWSER_TEST_NONE);
1015 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 1016 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
1016 1017
1017 GURL history_url(chrome::kChromeUIHistoryURL); 1018 GURL history_url(chrome::kChromeUIHistoryURL);
1018 ui_test_utils::NavigateToURL(browser(), history_url); 1019 ui_test_utils::NavigateToURL(browser(), history_url);
1019 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 1020 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
1020 1021
1021 GURL downloads_url(chrome::kChromeUIDownloadsURL); 1022 GURL downloads_url(chrome::kChromeUIDownloadsURL);
1022 ui_test_utils::NavigateToURL(browser(), downloads_url); 1023 ui_test_utils::NavigateToURL(browser(), downloads_url);
1023 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); 1024 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
1024 1025
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 #endif 2420 #endif
2420 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_GetSizeForNewRenderView) { 2421 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_GetSizeForNewRenderView) {
2421 ASSERT_TRUE(test_server()->Start()); 2422 ASSERT_TRUE(test_server()->Start());
2422 // Create an HTTPS server for cross-site transition. 2423 // Create an HTTPS server for cross-site transition.
2423 net::SpawnedTestServer https_test_server(net::SpawnedTestServer::TYPE_HTTPS, 2424 net::SpawnedTestServer https_test_server(net::SpawnedTestServer::TYPE_HTTPS,
2424 net::SpawnedTestServer::kLocalhost, 2425 net::SpawnedTestServer::kLocalhost,
2425 base::FilePath(kDocRoot)); 2426 base::FilePath(kDocRoot));
2426 ASSERT_TRUE(https_test_server.Start()); 2427 ASSERT_TRUE(https_test_server.Start());
2427 2428
2428 // Start with NTP. 2429 // Start with NTP.
2429 ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab")); 2430 ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal://newtab"));
2430 ASSERT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state()); 2431 ASSERT_EQ(BookmarkBar::DETACHED, browser()->bookmark_bar_state());
2431 WebContents* web_contents = 2432 WebContents* web_contents =
2432 browser()->tab_strip_model()->GetActiveWebContents(); 2433 browser()->tab_strip_model()->GetActiveWebContents();
2433 content::RenderViewHost* prev_rvh = web_contents->GetRenderViewHost(); 2434 content::RenderViewHost* prev_rvh = web_contents->GetRenderViewHost();
2434 const int height_inset = 2435 const int height_inset =
2435 browser()->window()->GetRenderViewHeightInsetWithDetachedBookmarkBar(); 2436 browser()->window()->GetRenderViewHeightInsetWithDetachedBookmarkBar();
2436 const gfx::Size initial_wcv_size = 2437 const gfx::Size initial_wcv_size =
2437 web_contents->GetView()->GetContainerSize(); 2438 web_contents->GetView()->GetContainerSize();
2438 RenderViewSizeObserver observer(web_contents, browser()->window()); 2439 RenderViewSizeObserver observer(web_contents, browser()->window());
2439 2440
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 &rwhv_create_size1, 2477 &rwhv_create_size1,
2477 &rwhv_commit_size1, 2478 &rwhv_commit_size1,
2478 &wcv_commit_size1); 2479 &wcv_commit_size1);
2479 EXPECT_EQ(rwhv_create_size1, rwhv_commit_size1); 2480 EXPECT_EQ(rwhv_create_size1, rwhv_commit_size1);
2480 EXPECT_EQ(rwhv_commit_size1, 2481 EXPECT_EQ(rwhv_commit_size1,
2481 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2482 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2482 EXPECT_EQ(wcv_commit_size1, web_contents->GetView()->GetContainerSize()); 2483 EXPECT_EQ(wcv_commit_size1, web_contents->GetView()->GetContainerSize());
2483 2484
2484 // Navigate from NTP to a non-NTP page, resizing WebContentsView while 2485 // Navigate from NTP to a non-NTP page, resizing WebContentsView while
2485 // navigation entry is pending. 2486 // navigation entry is pending.
2486 ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab")); 2487 ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal://newtab"));
2487 gfx::Size wcv_resize_insets(-34, -57); 2488 gfx::Size wcv_resize_insets(-34, -57);
2488 observer.set_wcv_resize_insets(wcv_resize_insets); 2489 observer.set_wcv_resize_insets(wcv_resize_insets);
2489 ui_test_utils::NavigateToURL(browser(), 2490 ui_test_utils::NavigateToURL(browser(),
2490 test_server()->GetURL("files/title2.html")); 2491 test_server()->GetURL("files/title2.html"));
2491 ASSERT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state()); 2492 ASSERT_EQ(BookmarkBar::HIDDEN, browser()->bookmark_bar_state());
2492 gfx::Size rwhv_create_size2, rwhv_commit_size2, wcv_commit_size2; 2493 gfx::Size rwhv_create_size2, rwhv_commit_size2, wcv_commit_size2;
2493 observer.GetSizeForRenderViewHost(web_contents->GetRenderViewHost(), 2494 observer.GetSizeForRenderViewHost(web_contents->GetRenderViewHost(),
2494 &rwhv_create_size2, 2495 &rwhv_create_size2,
2495 &rwhv_commit_size2, 2496 &rwhv_commit_size2,
2496 &wcv_commit_size2); 2497 &wcv_commit_size2);
2497 // The create height of RenderWidgetHostView should include the height inset. 2498 // The create height of RenderWidgetHostView should include the height inset.
2498 EXPECT_EQ(gfx::Size(initial_wcv_size.width(), 2499 EXPECT_EQ(gfx::Size(initial_wcv_size.width(),
2499 initial_wcv_size.height() + height_inset), 2500 initial_wcv_size.height() + height_inset),
2500 rwhv_create_size2); 2501 rwhv_create_size2);
2501 // WebContentsView was resized in 2502 // WebContentsView was resized in
2502 // RenderViewSizeObserver::NavigateToPendingEntry after RenderWidgetHostView 2503 // RenderViewSizeObserver::NavigateToPendingEntry after RenderWidgetHostView
2503 // was created, so the commit size should be resized accordingly. 2504 // was created, so the commit size should be resized accordingly.
2504 gfx::Size exp_commit_size(initial_wcv_size); 2505 gfx::Size exp_commit_size(initial_wcv_size);
2505 exp_commit_size.Enlarge(wcv_resize_insets.width(), 2506 exp_commit_size.Enlarge(wcv_resize_insets.width(),
2506 wcv_resize_insets.height() + height_inset); 2507 wcv_resize_insets.height() + height_inset);
2507 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2508 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2508 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2509 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2509 // Sizes of RenderWidgetHostView and WebContentsView before and after 2510 // Sizes of RenderWidgetHostView and WebContentsView before and after
2510 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. 2511 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same.
2511 EXPECT_EQ(rwhv_commit_size2, 2512 EXPECT_EQ(rwhv_commit_size2,
2512 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2513 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2513 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); 2514 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize());
2514 } 2515 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698