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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 // to an anchor in javascript body.onload handler. | 1130 // to an anchor in javascript body.onload handler. |
1131 IN_PROC_BROWSER_TEST_F(BrowserTest, | 1131 IN_PROC_BROWSER_TEST_F(BrowserTest, |
1132 DISABLED_FaviconOfOnloadRedirectToAnchorPage) { | 1132 DISABLED_FaviconOfOnloadRedirectToAnchorPage) { |
1133 ASSERT_TRUE(test_server()->Start()); | 1133 ASSERT_TRUE(test_server()->Start()); |
1134 GURL url(test_server()->GetURL("files/onload_redirect_to_anchor.html")); | 1134 GURL url(test_server()->GetURL("files/onload_redirect_to_anchor.html")); |
1135 GURL expected_favicon_url(test_server()->GetURL("files/test.png")); | 1135 GURL expected_favicon_url(test_server()->GetURL("files/test.png")); |
1136 | 1136 |
1137 ui_test_utils::NavigateToURL(browser(), url); | 1137 ui_test_utils::NavigateToURL(browser(), url); |
1138 | 1138 |
1139 NavigationEntry* entry = browser()->tab_strip_model()-> | 1139 NavigationEntry* entry = browser()->tab_strip_model()-> |
1140 GetActiveWebContents()->GetController().GetActiveEntry(); | 1140 GetActiveWebContents()->GetController().GetVisibleEntry(); |
1141 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); | 1141 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); |
1142 } | 1142 } |
1143 | 1143 |
1144 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined (OS_WIN) | 1144 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined (OS_WIN) |
1145 // http://crbug.com/83828. On Mac 10.6, the failure rate is 14% | 1145 // http://crbug.com/83828. On Mac 10.6, the failure rate is 14% |
1146 #define MAYBE_FaviconChange DISABLED_FaviconChange | 1146 #define MAYBE_FaviconChange DISABLED_FaviconChange |
1147 #else | 1147 #else |
1148 #define MAYBE_FaviconChange FaviconChange | 1148 #define MAYBE_FaviconChange FaviconChange |
1149 #endif | 1149 #endif |
1150 // Test that an icon can be changed from JS. | 1150 // Test that an icon can be changed from JS. |
1151 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { | 1151 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { |
1152 static const base::FilePath::CharType* kFile = | 1152 static const base::FilePath::CharType* kFile = |
1153 FILE_PATH_LITERAL("onload_change_favicon.html"); | 1153 FILE_PATH_LITERAL("onload_change_favicon.html"); |
1154 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( | 1154 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( |
1155 base::FilePath::kCurrentDirectory), base::FilePath(kFile))); | 1155 base::FilePath::kCurrentDirectory), base::FilePath(kFile))); |
1156 ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme)); | 1156 ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme)); |
1157 ui_test_utils::NavigateToURL(browser(), file_url); | 1157 ui_test_utils::NavigateToURL(browser(), file_url); |
1158 | 1158 |
1159 NavigationEntry* entry = browser()->tab_strip_model()-> | 1159 NavigationEntry* entry = browser()->tab_strip_model()-> |
1160 GetActiveWebContents()->GetController().GetActiveEntry(); | 1160 GetActiveWebContents()->GetController().GetVisibleEntry(); |
1161 static const base::FilePath::CharType* kIcon = | 1161 static const base::FilePath::CharType* kIcon = |
1162 FILE_PATH_LITERAL("test1.png"); | 1162 FILE_PATH_LITERAL("test1.png"); |
1163 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( | 1163 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( |
1164 base::FilePath::kCurrentDirectory), base::FilePath(kIcon))); | 1164 base::FilePath::kCurrentDirectory), base::FilePath(kIcon))); |
1165 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); | 1165 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); |
1166 } | 1166 } |
1167 | 1167 |
1168 // http://crbug.com/172336 | 1168 // http://crbug.com/172336 |
1169 #if defined(OS_WIN) | 1169 #if defined(OS_WIN) |
1170 #define MAYBE_TabClosingWhenRemovingExtension \ | 1170 #define MAYBE_TabClosingWhenRemovingExtension \ |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 exp_commit_size.Enlarge(wcv_resize_insets.width(), | 2550 exp_commit_size.Enlarge(wcv_resize_insets.width(), |
2551 wcv_resize_insets.height() + height_inset); | 2551 wcv_resize_insets.height() + height_inset); |
2552 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2552 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2553 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2553 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2554 // Sizes of RenderWidgetHostView and WebContentsView before and after | 2554 // Sizes of RenderWidgetHostView and WebContentsView before and after |
2555 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. | 2555 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. |
2556 EXPECT_EQ(rwhv_commit_size2, | 2556 EXPECT_EQ(rwhv_commit_size2, |
2557 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2557 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2558 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); | 2558 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); |
2559 } | 2559 } |
OLD | NEW |