OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/test/automation/tab_proxy.h" | 11 #include "chrome/test/automation/tab_proxy.h" |
12 #include "chrome/test/automation/browser_proxy.h" | 12 #include "chrome/test/automation/browser_proxy.h" |
13 #include "chrome/test/automation/window_proxy.h" | 13 #include "chrome/test/automation/window_proxy.h" |
14 #include "chrome/test/ui/ui_test.h" | 14 #include "chrome/test/ui/ui_test.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
17 #include "net/url_request/url_request_unittest.h" | 17 #include "net/url_request/url_request_unittest.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 class SessionRestoreUITest : public UITest { | 21 class SessionRestoreUITest : public UITest { |
22 protected: | 22 protected: |
23 SessionRestoreUITest() : UITest() { | 23 SessionRestoreUITest() : UITest() { |
24 std::wstring path_prefix = test_data_directory_; | 24 FilePath path_prefix = FilePath::FromWStringHack(test_data_directory_); |
25 file_util::AppendToPath(&path_prefix, L"session_history"); | 25 path_prefix = path_prefix.Append(FILE_PATH_LITERAL("session_history")) |
26 path_prefix += file_util::kPathSeparator; | 26 .Append(FilePath::StringType(&FilePath::kSeparators[0], 1)); |
27 | 27 |
28 url1 = net::FilePathToFileURL(path_prefix + L"bot1.html"); | 28 url1 = net::FilePathToFileURL( |
29 url2 = net::FilePathToFileURL(path_prefix + L"bot2.html"); | 29 path_prefix.Append(FILE_PATH_LITERAL("bot1.html"))); |
30 url3 = net::FilePathToFileURL(path_prefix + L"bot3.html"); | 30 url2 = net::FilePathToFileURL( |
| 31 path_prefix.Append(FILE_PATH_LITERAL("bot2.html"))); |
| 32 url3 = net::FilePathToFileURL( |
| 33 path_prefix.Append(FILE_PATH_LITERAL("bot3.html"))); |
31 } | 34 } |
32 | 35 |
33 virtual void QuitBrowserAndRestore() { | 36 virtual void QuitBrowserAndRestore() { |
34 UITest::TearDown(); | 37 UITest::TearDown(); |
35 | 38 |
36 clear_profile_ = false; | 39 clear_profile_ = false; |
37 | 40 |
38 CommandLine::AppendSwitch(&launch_arguments_, | 41 CommandLine::AppendSwitch(&launch_arguments_, |
39 switches::kRestoreLastSession); | 42 switches::kRestoreLastSession); |
40 UITest::SetUp(); | 43 UITest::SetUp(); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(restored_tab_count - 2)); | 422 scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(restored_tab_count - 2)); |
420 ASSERT_TRUE(tab_proxy.get() != NULL); | 423 ASSERT_TRUE(tab_proxy.get() != NULL); |
421 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); | 424 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); |
422 tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); | 425 tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); |
423 ASSERT_TRUE(tab_proxy.get() != NULL); | 426 ASSERT_TRUE(tab_proxy.get() != NULL); |
424 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); | 427 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); |
425 | 428 |
426 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); | 429 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); |
427 } | 430 } |
428 | 431 |
OLD | NEW |