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

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

Issue 305243002: Replace usage of GetActiveEntry with GetLastCommittedEntry in chrome/browser/ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes based on pkasting's review. Created 6 years, 6 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/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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 // to an anchor in javascript body.onload handler. 1231 // to an anchor in javascript body.onload handler.
1232 IN_PROC_BROWSER_TEST_F(BrowserTest, 1232 IN_PROC_BROWSER_TEST_F(BrowserTest,
1233 DISABLED_FaviconOfOnloadRedirectToAnchorPage) { 1233 DISABLED_FaviconOfOnloadRedirectToAnchorPage) {
1234 ASSERT_TRUE(test_server()->Start()); 1234 ASSERT_TRUE(test_server()->Start());
1235 GURL url(test_server()->GetURL("files/onload_redirect_to_anchor.html")); 1235 GURL url(test_server()->GetURL("files/onload_redirect_to_anchor.html"));
1236 GURL expected_favicon_url(test_server()->GetURL("files/test.png")); 1236 GURL expected_favicon_url(test_server()->GetURL("files/test.png"));
1237 1237
1238 ui_test_utils::NavigateToURL(browser(), url); 1238 ui_test_utils::NavigateToURL(browser(), url);
1239 1239
1240 NavigationEntry* entry = browser()->tab_strip_model()-> 1240 NavigationEntry* entry = browser()->tab_strip_model()->
1241 GetActiveWebContents()->GetController().GetActiveEntry(); 1241 GetActiveWebContents()->GetController().GetLastCommittedEntry();
1242 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); 1242 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec());
1243 } 1243 }
1244 1244
1245 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined (OS_WIN) 1245 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined (OS_WIN)
1246 // http://crbug.com/83828. On Mac 10.6, the failure rate is 14% 1246 // http://crbug.com/83828. On Mac 10.6, the failure rate is 14%
1247 #define MAYBE_FaviconChange DISABLED_FaviconChange 1247 #define MAYBE_FaviconChange DISABLED_FaviconChange
1248 #else 1248 #else
1249 #define MAYBE_FaviconChange FaviconChange 1249 #define MAYBE_FaviconChange FaviconChange
1250 #endif 1250 #endif
1251 // Test that an icon can be changed from JS. 1251 // Test that an icon can be changed from JS.
1252 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { 1252 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) {
1253 static const base::FilePath::CharType* kFile = 1253 static const base::FilePath::CharType* kFile =
1254 FILE_PATH_LITERAL("onload_change_favicon.html"); 1254 FILE_PATH_LITERAL("onload_change_favicon.html");
1255 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( 1255 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath(
1256 base::FilePath::kCurrentDirectory), base::FilePath(kFile))); 1256 base::FilePath::kCurrentDirectory), base::FilePath(kFile)));
1257 ASSERT_TRUE(file_url.SchemeIs(url::kFileScheme)); 1257 ASSERT_TRUE(file_url.SchemeIs(url::kFileScheme));
1258 ui_test_utils::NavigateToURL(browser(), file_url); 1258 ui_test_utils::NavigateToURL(browser(), file_url);
1259 1259
1260 NavigationEntry* entry = browser()->tab_strip_model()-> 1260 NavigationEntry* entry = browser()->tab_strip_model()->
1261 GetActiveWebContents()->GetController().GetActiveEntry(); 1261 GetActiveWebContents()->GetController().GetLastCommittedEntry();
1262 static const base::FilePath::CharType* kIcon = 1262 static const base::FilePath::CharType* kIcon =
1263 FILE_PATH_LITERAL("test1.png"); 1263 FILE_PATH_LITERAL("test1.png");
1264 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( 1264 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath(
1265 base::FilePath::kCurrentDirectory), base::FilePath(kIcon))); 1265 base::FilePath::kCurrentDirectory), base::FilePath(kIcon)));
1266 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); 1266 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec());
1267 } 1267 }
1268 1268
1269 // http://crbug.com/172336 1269 // http://crbug.com/172336
1270 #if defined(OS_WIN) 1270 #if defined(OS_WIN)
1271 #define MAYBE_TabClosingWhenRemovingExtension \ 1271 #define MAYBE_TabClosingWhenRemovingExtension \
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 #endif 2686 #endif
2687 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2687 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2688 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2688 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2689 gfx::Size exp_final_size(initial_wcv_size); 2689 gfx::Size exp_final_size(initial_wcv_size);
2690 exp_final_size.Enlarge(wcv_resize_insets.width(), 2690 exp_final_size.Enlarge(wcv_resize_insets.width(),
2691 wcv_resize_insets.height() + height_inset); 2691 wcv_resize_insets.height() + height_inset);
2692 EXPECT_EQ(exp_final_size, 2692 EXPECT_EQ(exp_final_size,
2693 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2693 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2694 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2694 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2695 } 2695 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698