Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1618)

Side by Side Diff: chrome/browser/pref_service_uitest.cc

Issue 3012021: CommandLine: add a CopySwitchesFrom() for copying from another CommandLine (Closed)
Patch Set: minor cleanups Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/plugin_process_host.cc ('k') | chrome/browser/printing/printing_layout_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698