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

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

Issue 22882007: Remove GetActiveEntry usage from chrome/browser/ui. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT. 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 // to an anchor in javascript body.onload handler. 1083 // to an anchor in javascript body.onload handler.
1084 IN_PROC_BROWSER_TEST_F(BrowserTest, 1084 IN_PROC_BROWSER_TEST_F(BrowserTest,
1085 DISABLED_FaviconOfOnloadRedirectToAnchorPage) { 1085 DISABLED_FaviconOfOnloadRedirectToAnchorPage) {
1086 ASSERT_TRUE(test_server()->Start()); 1086 ASSERT_TRUE(test_server()->Start());
1087 GURL url(test_server()->GetURL("files/onload_redirect_to_anchor.html")); 1087 GURL url(test_server()->GetURL("files/onload_redirect_to_anchor.html"));
1088 GURL expected_favicon_url(test_server()->GetURL("files/test.png")); 1088 GURL expected_favicon_url(test_server()->GetURL("files/test.png"));
1089 1089
1090 ui_test_utils::NavigateToURL(browser(), url); 1090 ui_test_utils::NavigateToURL(browser(), url);
1091 1091
1092 NavigationEntry* entry = browser()->tab_strip_model()-> 1092 NavigationEntry* entry = browser()->tab_strip_model()->
1093 GetActiveWebContents()->GetController().GetActiveEntry(); 1093 GetActiveWebContents()->GetController().GetVisibleEntry();
1094 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); 1094 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec());
1095 } 1095 }
1096 1096
1097 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined (OS_WIN) 1097 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined (OS_WIN)
1098 // http://crbug.com/83828. On Mac 10.6, the failure rate is 14% 1098 // http://crbug.com/83828. On Mac 10.6, the failure rate is 14%
1099 #define MAYBE_FaviconChange DISABLED_FaviconChange 1099 #define MAYBE_FaviconChange DISABLED_FaviconChange
1100 #else 1100 #else
1101 #define MAYBE_FaviconChange FaviconChange 1101 #define MAYBE_FaviconChange FaviconChange
1102 #endif 1102 #endif
1103 // Test that an icon can be changed from JS. 1103 // Test that an icon can be changed from JS.
1104 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { 1104 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) {
1105 static const base::FilePath::CharType* kFile = 1105 static const base::FilePath::CharType* kFile =
1106 FILE_PATH_LITERAL("onload_change_favicon.html"); 1106 FILE_PATH_LITERAL("onload_change_favicon.html");
1107 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( 1107 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath(
1108 base::FilePath::kCurrentDirectory), base::FilePath(kFile))); 1108 base::FilePath::kCurrentDirectory), base::FilePath(kFile)));
1109 ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme)); 1109 ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme));
1110 ui_test_utils::NavigateToURL(browser(), file_url); 1110 ui_test_utils::NavigateToURL(browser(), file_url);
1111 1111
1112 NavigationEntry* entry = browser()->tab_strip_model()-> 1112 NavigationEntry* entry = browser()->tab_strip_model()->
1113 GetActiveWebContents()->GetController().GetActiveEntry(); 1113 GetActiveWebContents()->GetController().GetVisibleEntry();
1114 static const base::FilePath::CharType* kIcon = 1114 static const base::FilePath::CharType* kIcon =
1115 FILE_PATH_LITERAL("test1.png"); 1115 FILE_PATH_LITERAL("test1.png");
1116 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( 1116 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath(
1117 base::FilePath::kCurrentDirectory), base::FilePath(kIcon))); 1117 base::FilePath::kCurrentDirectory), base::FilePath(kIcon)));
1118 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); 1118 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec());
1119 } 1119 }
1120 1120
1121 // http://crbug.com/172336 1121 // http://crbug.com/172336
1122 #if defined(OS_WIN) 1122 #if defined(OS_WIN)
1123 #define MAYBE_TabClosingWhenRemovingExtension \ 1123 #define MAYBE_TabClosingWhenRemovingExtension \
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 exp_commit_size.Enlarge(wcv_resize_insets.width(), 2502 exp_commit_size.Enlarge(wcv_resize_insets.width(),
2503 wcv_resize_insets.height() + height_inset); 2503 wcv_resize_insets.height() + height_inset);
2504 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2504 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2505 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2505 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2506 // Sizes of RenderWidgetHostView and WebContentsView before and after 2506 // Sizes of RenderWidgetHostView and WebContentsView before and after
2507 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. 2507 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same.
2508 EXPECT_EQ(rwhv_commit_size2, 2508 EXPECT_EQ(rwhv_commit_size2,
2509 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2509 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2510 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); 2510 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize());
2511 } 2511 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698