OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/test/test_file_util.h" | 10 #include "base/test/test_file_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Copy only the Local State file, the rest will be automatically created | 42 // Copy only the Local State file, the rest will be automatically created |
43 ASSERT_TRUE(file_util::CopyFile(reference_pref_file, tmp_pref_file_)); | 43 ASSERT_TRUE(file_util::CopyFile(reference_pref_file, tmp_pref_file_)); |
44 | 44 |
45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
46 // Make the copy writable. On POSIX we assume the umask allows files | 46 // Make the copy writable. On POSIX we assume the umask allows files |
47 // we create to be writable. | 47 // we create to be writable. |
48 ASSERT_TRUE(::SetFileAttributesW(tmp_pref_file_.value().c_str(), | 48 ASSERT_TRUE(::SetFileAttributesW(tmp_pref_file_.value().c_str(), |
49 FILE_ATTRIBUTE_NORMAL)); | 49 FILE_ATTRIBUTE_NORMAL)); |
50 #endif | 50 #endif |
51 | 51 |
52 launch_arguments_.AppendSwitchWithValue(switches::kUserDataDir, | 52 launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile_); |
53 tmp_profile_.ToWStringHack()); | |
54 } | 53 } |
55 | 54 |
56 bool LaunchAppWithProfile() { | 55 bool LaunchAppWithProfile() { |
57 if (!file_util::PathExists(tmp_pref_file_)) | 56 if (!file_util::PathExists(tmp_pref_file_)) |
58 return false; | 57 return false; |
59 UITest::SetUp(); | 58 UITest::SetUp(); |
60 return true; | 59 return true; |
61 } | 60 } |
62 | 61 |
63 void TearDown() { | 62 void TearDown() { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 125 |
127 // Find if launched window is maximized. | 126 // Find if launched window is maximized. |
128 bool is_window_maximized = false; | 127 bool is_window_maximized = false; |
129 ASSERT_TRUE(window->IsMaximized(&is_window_maximized)); | 128 ASSERT_TRUE(window->IsMaximized(&is_window_maximized)); |
130 bool is_maximized = false; | 129 bool is_maximized = false; |
131 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", | 130 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", |
132 &is_maximized)); | 131 &is_maximized)); |
133 EXPECT_EQ(is_maximized, is_window_maximized); | 132 EXPECT_EQ(is_maximized, is_window_maximized); |
134 } | 133 } |
135 #endif | 134 #endif |
OLD | NEW |