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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 CHECK(file_util::CreateDirectory(tmp_pref_file_)); | 70 CHECK(file_util::CreateDirectory(tmp_pref_file_)); |
71 tmp_pref_file_ = tmp_pref_file_.Append(chrome::kPreferencesFilename); | 71 tmp_pref_file_ = tmp_pref_file_.Append(chrome::kPreferencesFilename); |
72 } else { | 72 } else { |
73 reference_pref_file = ui_test_utils::GetTestFilePath( | 73 reference_pref_file = ui_test_utils::GetTestFilePath( |
74 base::FilePath().AppendASCII("profiles"). | 74 base::FilePath().AppendASCII("profiles"). |
75 AppendASCII("window_placement"), | 75 AppendASCII("window_placement"), |
76 base::FilePath().Append(chrome::kLocalStateFilename)); | 76 base::FilePath().Append(chrome::kLocalStateFilename)); |
77 tmp_pref_file_ = user_data_directory.Append(chrome::kLocalStateFilename); | 77 tmp_pref_file_ = user_data_directory.Append(chrome::kLocalStateFilename); |
78 } | 78 } |
79 | 79 |
80 CHECK(file_util::PathExists(reference_pref_file)); | 80 CHECK(base::PathExists(reference_pref_file)); |
81 // Copy only the Preferences file if |new_profile_|, or Local State if not, | 81 // Copy only the Preferences file if |new_profile_|, or Local State if not, |
82 // and the rest will be automatically created. | 82 // and the rest will be automatically created. |
83 CHECK(base::CopyFile(reference_pref_file, tmp_pref_file_)); | 83 CHECK(base::CopyFile(reference_pref_file, tmp_pref_file_)); |
84 | 84 |
85 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
86 // Make the copy writable. On POSIX we assume the umask allows files | 86 // Make the copy writable. On POSIX we assume the umask allows files |
87 // we create to be writable. | 87 // we create to be writable. |
88 CHECK(::SetFileAttributesW(tmp_pref_file_.value().c_str(), | 88 CHECK(::SetFileAttributesW(tmp_pref_file_.value().c_str(), |
89 FILE_ATTRIBUTE_NORMAL)); | 89 FILE_ATTRIBUTE_NORMAL)); |
90 #endif | 90 #endif |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 EXPECT_EQ(right, bounds.x() + bounds.width()); | 206 EXPECT_EQ(right, bounds.x() + bounds.width()); |
207 | 207 |
208 // Find if launched window is maximized. | 208 // Find if launched window is maximized. |
209 bool is_window_maximized = browser()->window()->IsMaximized(); | 209 bool is_window_maximized = browser()->window()->IsMaximized(); |
210 bool is_maximized = false; | 210 bool is_maximized = false; |
211 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", | 211 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", |
212 &is_maximized)); | 212 &is_maximized)); |
213 EXPECT_EQ(is_maximized, is_window_maximized); | 213 EXPECT_EQ(is_maximized, is_window_maximized); |
214 } | 214 } |
215 #endif | 215 #endif |
OLD | NEW |