| 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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 // on the Mac. http://crbug.com/13148 | 1101 // on the Mac. http://crbug.com/13148 |
| 1102 #if !defined(OS_MACOSX) | 1102 #if !defined(OS_MACOSX) |
| 1103 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFile) { | 1103 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFile) { |
| 1104 CommandUpdater* command_updater = | 1104 CommandUpdater* command_updater = |
| 1105 browser()->command_controller()->command_updater(); | 1105 browser()->command_controller()->command_updater(); |
| 1106 | 1106 |
| 1107 static const base::FilePath::CharType* kEmptyFile = | 1107 static const base::FilePath::CharType* kEmptyFile = |
| 1108 FILE_PATH_LITERAL("empty.html"); | 1108 FILE_PATH_LITERAL("empty.html"); |
| 1109 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( | 1109 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( |
| 1110 base::FilePath::kCurrentDirectory), base::FilePath(kEmptyFile))); | 1110 base::FilePath::kCurrentDirectory), base::FilePath(kEmptyFile))); |
| 1111 ASSERT_TRUE(file_url.SchemeIs(content::kFileScheme)); | 1111 ASSERT_TRUE(file_url.SchemeIs(url::kFileScheme)); |
| 1112 ui_test_utils::NavigateToURL(browser(), file_url); | 1112 ui_test_utils::NavigateToURL(browser(), file_url); |
| 1113 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); | 1113 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { | 1116 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { |
| 1117 CommandUpdater* command_updater = | 1117 CommandUpdater* command_updater = |
| 1118 browser()->command_controller()->command_updater(); | 1118 browser()->command_controller()->command_updater(); |
| 1119 | 1119 |
| 1120 ASSERT_TRUE(test_server()->Start()); | 1120 ASSERT_TRUE(test_server()->Start()); |
| 1121 GURL http_url(test_server()->GetURL(std::string())); | 1121 GURL http_url(test_server()->GetURL(std::string())); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1140 | 1140 |
| 1141 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFtp) { | 1141 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFtp) { |
| 1142 CommandUpdater* command_updater = | 1142 CommandUpdater* command_updater = |
| 1143 browser()->command_controller()->command_updater(); | 1143 browser()->command_controller()->command_updater(); |
| 1144 | 1144 |
| 1145 net::SpawnedTestServer test_server(net::SpawnedTestServer::TYPE_FTP, | 1145 net::SpawnedTestServer test_server(net::SpawnedTestServer::TYPE_FTP, |
| 1146 net::SpawnedTestServer::kLocalhost, | 1146 net::SpawnedTestServer::kLocalhost, |
| 1147 base::FilePath(kDocRoot)); | 1147 base::FilePath(kDocRoot)); |
| 1148 ASSERT_TRUE(test_server.Start()); | 1148 ASSERT_TRUE(test_server.Start()); |
| 1149 GURL ftp_url(test_server.GetURL(std::string())); | 1149 GURL ftp_url(test_server.GetURL(std::string())); |
| 1150 ASSERT_TRUE(ftp_url.SchemeIs(content::kFtpScheme)); | 1150 ASSERT_TRUE(ftp_url.SchemeIs(url::kFtpScheme)); |
| 1151 ui_test_utils::NavigateToURL(browser(), ftp_url); | 1151 ui_test_utils::NavigateToURL(browser(), ftp_url); |
| 1152 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); | 1152 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { | 1155 IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { |
| 1156 CommandUpdater* command_updater = | 1156 CommandUpdater* command_updater = |
| 1157 browser()->command_controller()->command_updater(); | 1157 browser()->command_controller()->command_updater(); |
| 1158 | 1158 |
| 1159 // Urls that should not have shortcuts. | 1159 // Urls that should not have shortcuts. |
| 1160 GURL new_tab_url(chrome::kChromeUINewTabURL); | 1160 GURL new_tab_url(chrome::kChromeUINewTabURL); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 #define MAYBE_FaviconChange DISABLED_FaviconChange | 1246 #define MAYBE_FaviconChange DISABLED_FaviconChange |
| 1247 #else | 1247 #else |
| 1248 #define MAYBE_FaviconChange FaviconChange | 1248 #define MAYBE_FaviconChange FaviconChange |
| 1249 #endif | 1249 #endif |
| 1250 // Test that an icon can be changed from JS. | 1250 // Test that an icon can be changed from JS. |
| 1251 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { | 1251 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { |
| 1252 static const base::FilePath::CharType* kFile = | 1252 static const base::FilePath::CharType* kFile = |
| 1253 FILE_PATH_LITERAL("onload_change_favicon.html"); | 1253 FILE_PATH_LITERAL("onload_change_favicon.html"); |
| 1254 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( | 1254 GURL file_url(ui_test_utils::GetTestUrl(base::FilePath( |
| 1255 base::FilePath::kCurrentDirectory), base::FilePath(kFile))); | 1255 base::FilePath::kCurrentDirectory), base::FilePath(kFile))); |
| 1256 ASSERT_TRUE(file_url.SchemeIs(content::kFileScheme)); | 1256 ASSERT_TRUE(file_url.SchemeIs(url::kFileScheme)); |
| 1257 ui_test_utils::NavigateToURL(browser(), file_url); | 1257 ui_test_utils::NavigateToURL(browser(), file_url); |
| 1258 | 1258 |
| 1259 NavigationEntry* entry = browser()->tab_strip_model()-> | 1259 NavigationEntry* entry = browser()->tab_strip_model()-> |
| 1260 GetActiveWebContents()->GetController().GetActiveEntry(); | 1260 GetActiveWebContents()->GetController().GetActiveEntry(); |
| 1261 static const base::FilePath::CharType* kIcon = | 1261 static const base::FilePath::CharType* kIcon = |
| 1262 FILE_PATH_LITERAL("test1.png"); | 1262 FILE_PATH_LITERAL("test1.png"); |
| 1263 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( | 1263 GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( |
| 1264 base::FilePath::kCurrentDirectory), base::FilePath(kIcon))); | 1264 base::FilePath::kCurrentDirectory), base::FilePath(kIcon))); |
| 1265 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); | 1265 EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); |
| 1266 } | 1266 } |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 #endif | 2701 #endif |
| 2702 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2702 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
| 2703 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2703 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
| 2704 gfx::Size exp_final_size(initial_wcv_size); | 2704 gfx::Size exp_final_size(initial_wcv_size); |
| 2705 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2705 exp_final_size.Enlarge(wcv_resize_insets.width(), |
| 2706 wcv_resize_insets.height() + height_inset); | 2706 wcv_resize_insets.height() + height_inset); |
| 2707 EXPECT_EQ(exp_final_size, | 2707 EXPECT_EQ(exp_final_size, |
| 2708 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2708 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
| 2709 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2709 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
| 2710 } | 2710 } |
| OLD | NEW |