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

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

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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
« no previous file with comments | « chrome/common/main_function_params.h ('k') | chrome/common/temp_scaffolding_stubs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <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/values.h" 9 #include "base/values.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
(...skipping 25 matching lines...) Expand all
36 ASSERT_TRUE(file_util::PathExists(reference_pref_file)); 36 ASSERT_TRUE(file_util::PathExists(reference_pref_file));
37 37
38 // Copy only the Local State file, the rest will be automatically created 38 // Copy only the Local State file, the rest will be automatically created
39 ASSERT_TRUE(::CopyFileW(reference_pref_file.c_str(), tmp_pref_file_.c_str(), 39 ASSERT_TRUE(::CopyFileW(reference_pref_file.c_str(), tmp_pref_file_.c_str(),
40 TRUE)); 40 TRUE));
41 41
42 // Make the copy writable 42 // Make the copy writable
43 ASSERT_TRUE(::SetFileAttributesW(tmp_pref_file_.c_str(), 43 ASSERT_TRUE(::SetFileAttributesW(tmp_pref_file_.c_str(),
44 FILE_ATTRIBUTE_NORMAL)); 44 FILE_ATTRIBUTE_NORMAL));
45 45
46 CommandLine::AppendSwitchWithValue(&launch_arguments_, 46 launch_arguments_.AppendSwitchWithValue(switches::kUserDataDir,
47 switches::kUserDataDir, 47 tmp_profile_);
48 tmp_profile_);
49 } 48 }
50 49
51 bool LaunchAppWithProfile() { 50 bool LaunchAppWithProfile() {
52 if (!file_util::PathExists(tmp_pref_file_)) 51 if (!file_util::PathExists(tmp_pref_file_))
53 return false; 52 return false;
54 UITest::SetUp(); 53 UITest::SetUp();
55 return true; 54 return true;
56 } 55 }
57 56
58 void TearDown() { 57 void TearDown() {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 123
125 // Find if launched window is maximized 124 // Find if launched window is maximized
126 bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE); 125 bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE);
127 126
128 bool is_maximized = false; 127 bool is_maximized = false;
129 ASSERT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", 128 ASSERT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized",
130 &is_maximized)); 129 &is_maximized));
131 ASSERT_EQ(is_maximized, is_window_maximized); 130 ASSERT_EQ(is_maximized, is_window_maximized);
132 } 131 }
133 132
OLDNEW
« no previous file with comments | « chrome/common/main_function_params.h ('k') | chrome/common/temp_scaffolding_stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698