OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
11 #include "base/test/test_file_util.h" | 11 #include "base/test/test_file_util.h" |
12 #include "base/test/test_timeouts.h" | 12 #include "base/test/test_timeouts.h" |
13 #include "base/utf_string_conversions.h" | |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/browser/platform_util.h" | 16 #include "chrome/browser/platform_util.h" |
16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
18 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
20 #include "chrome/test/automation/browser_proxy.h" | 21 #include "chrome/test/automation/browser_proxy.h" |
21 #include "chrome/test/automation/tab_proxy.h" | 22 #include "chrome/test/automation/tab_proxy.h" |
22 #include "chrome/test/automation/window_proxy.h" | 23 #include "chrome/test/automation/window_proxy.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 // At this point the modal dialog should not be showing. | 222 // At this point the modal dialog should not be showing. |
222 int window_count = 0; | 223 int window_count = 0; |
223 EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count)); | 224 EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count)); |
224 EXPECT_EQ(1, window_count); | 225 EXPECT_EQ(1, window_count); |
225 | 226 |
226 // Verify that we set a mark on successful dialog show. | 227 // Verify that we set a mark on successful dialog show. |
227 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); | 228 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); |
228 ASSERT_TRUE(browser.get()); | 229 ASSERT_TRUE(browser.get()); |
229 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); | 230 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); |
230 ASSERT_TRUE(tab.get()); | 231 ASSERT_TRUE(tab.get()); |
231 std::wstring title; | 232 string16 title; |
232 ASSERT_TRUE(tab->GetTabTitle(&title)); | 233 ASSERT_TRUE(tab->GetTabTitle(&title)); |
233 ASSERT_EQ(L"SUCCESS", title); | 234 ASSERT_EQ(ASCIIToUTF16("SUCCESS"), title); |
234 } | 235 } |
235 | 236 |
236 class SecurityTest : public UITest { | 237 class SecurityTest : public UITest { |
237 }; | 238 }; |
238 | 239 |
239 TEST_F(SecurityTest, DisallowFileUrlUniversalAccessTest) { | 240 TEST_F(SecurityTest, DisallowFileUrlUniversalAccessTest) { |
240 scoped_refptr<TabProxy> tab(GetActiveTab()); | 241 scoped_refptr<TabProxy> tab(GetActiveTab()); |
241 ASSERT_TRUE(tab.get()); | 242 ASSERT_TRUE(tab.get()); |
242 | 243 |
243 FilePath test_file(test_data_directory_); | 244 FilePath test_file(test_data_directory_); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 #endif // !defined(OS_MACOSX) | 279 #endif // !defined(OS_MACOSX) |
279 | 280 |
280 #if defined(OS_WIN) | 281 #if defined(OS_WIN) |
281 // This test verifies that Chrome can be launched with a user-data-dir path | 282 // This test verifies that Chrome can be launched with a user-data-dir path |
282 // which contains non ASCII characters. | 283 // which contains non ASCII characters. |
283 class LaunchBrowserWithNonAsciiUserDatadir : public UITest { | 284 class LaunchBrowserWithNonAsciiUserDatadir : public UITest { |
284 public: | 285 public: |
285 void SetUp() { | 286 void SetUp() { |
286 PathService::Get(base::DIR_TEMP, &tmp_profile_); | 287 PathService::Get(base::DIR_TEMP, &tmp_profile_); |
287 tmp_profile_ = tmp_profile_.AppendASCII("tmp_profile"); | 288 tmp_profile_ = tmp_profile_.AppendASCII("tmp_profile"); |
288 tmp_profile_ = tmp_profile_.Append(L"Test Chrome G�raldine"); | 289 tmp_profile_ = tmp_profile_.Append(L"Test Chrome G\u00E9raldine"); |
Evan Martin
2011/02/04 21:37:29
Good fix!
Avi (use Gerrit)
2011/02/04 23:02:11
Presubmit complained. Why does no one listen?
| |
289 | 290 |
290 // Create a fresh, empty copy of this directory. | 291 // Create a fresh, empty copy of this directory. |
291 file_util::Delete(tmp_profile_, true); | 292 file_util::Delete(tmp_profile_, true); |
292 file_util::CreateDirectory(tmp_profile_); | 293 file_util::CreateDirectory(tmp_profile_); |
293 | 294 |
294 launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile_); | 295 launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile_); |
295 } | 296 } |
296 | 297 |
297 bool LaunchAppWithProfile() { | 298 bool LaunchAppWithProfile() { |
298 UITest::SetUp(); | 299 UITest::SetUp(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 EXPECT_EQ(0, window_count); | 385 EXPECT_EQ(0, window_count); |
385 | 386 |
386 // Starting a browser window should work just fine. | 387 // Starting a browser window should work just fine. |
387 ASSERT_TRUE(IsBrowserRunning()); | 388 ASSERT_TRUE(IsBrowserRunning()); |
388 ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true)); | 389 ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true)); |
389 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); | 390 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); |
390 EXPECT_EQ(1, window_count); | 391 EXPECT_EQ(1, window_count); |
391 } | 392 } |
392 | 393 |
393 } // namespace | 394 } // namespace |
OLD | NEW |