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 FilePath path_prefix = FilePath::FromWStringHack(test_data_directory_); | 24 FilePath path_prefix = FilePath::FromWStringHack(test_data_directory_); |
25 path_prefix = path_prefix.Append(FILE_PATH_LITERAL("session_history")) | 25 path_prefix = path_prefix.AppendASCII("session_history") |
26 .Append(FilePath::StringType(&FilePath::kSeparators[0], 1)); | 26 .Append(FilePath::StringType(&FilePath::kSeparators[0], 1)); |
27 | 27 |
28 url1 = net::FilePathToFileURL( | 28 url1 = net::FilePathToFileURL( |
29 path_prefix.Append(FILE_PATH_LITERAL("bot1.html"))); | 29 path_prefix.AppendASCII("bot1.html")); |
30 url2 = net::FilePathToFileURL( | 30 url2 = net::FilePathToFileURL( |
31 path_prefix.Append(FILE_PATH_LITERAL("bot2.html"))); | 31 path_prefix.AppendASCII("bot2.html")); |
32 url3 = net::FilePathToFileURL( | 32 url3 = net::FilePathToFileURL( |
33 path_prefix.Append(FILE_PATH_LITERAL("bot3.html"))); | 33 path_prefix.AppendASCII("bot3.html")); |
34 } | 34 } |
35 | 35 |
36 virtual void QuitBrowserAndRestore() { | 36 virtual void QuitBrowserAndRestore() { |
37 UITest::TearDown(); | 37 UITest::TearDown(); |
38 | 38 |
39 clear_profile_ = false; | 39 clear_profile_ = false; |
40 | 40 |
41 launch_arguments_.AppendSwitch(switches::kRestoreLastSession); | 41 launch_arguments_.AppendSwitch(switches::kRestoreLastSession); |
42 UITest::SetUp(); | 42 UITest::SetUp(); |
43 } | 43 } |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 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)); |
423 ASSERT_TRUE(tab_proxy.get() != NULL); | 423 ASSERT_TRUE(tab_proxy.get() != NULL); |
424 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); | 424 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); |
425 tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); | 425 tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); |
426 ASSERT_TRUE(tab_proxy.get() != NULL); | 426 ASSERT_TRUE(tab_proxy.get() != NULL); |
427 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); | 427 ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); |
428 | 428 |
429 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); | 429 ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); |
430 } | 430 } |
431 | 431 |
OLD | NEW |