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

Side by Side Diff: chrome/installer/util/google_chrome_distribution_unittest.cc

Issue 99165: Add two new master preferences. (Closed)
Patch Set: Created 11 years, 8 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/browser/first_run.cc ('k') | chrome/installer/util/master_preferences.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 // Unit tests for GoogleChromeDistribution class. 5 // Unit tests for GoogleChromeDistribution class.
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/registry.h" 9 #include "base/registry.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 TEST(MasterPreferences, ParseDistroParams) { 258 TEST(MasterPreferences, ParseDistroParams) {
259 std::wstring prefs; 259 std::wstring prefs;
260 ASSERT_TRUE(file_util::CreateTemporaryFileName(&prefs)); 260 ASSERT_TRUE(file_util::CreateTemporaryFileName(&prefs));
261 const char text[] = 261 const char text[] =
262 "{ \n" 262 "{ \n"
263 " \"distribution\": { \n" 263 " \"distribution\": { \n"
264 " \"skip_first_run_ui\": true,\n" 264 " \"skip_first_run_ui\": true,\n"
265 " \"show_welcome_page\": true,\n" 265 " \"show_welcome_page\": true,\n"
266 " \"import_search_engine\": true,\n" 266 " \"import_search_engine\": true,\n"
267 " \"import_history\": true,\n" 267 " \"import_history\": true,\n"
268 " \"import_bookmarks\": true,\n"
268 " \"create_all_shortcuts\": true,\n" 269 " \"create_all_shortcuts\": true,\n"
269 " \"do_not_launch_chrome\": true,\n" 270 " \"do_not_launch_chrome\": true,\n"
270 " \"make_chrome_default\": true,\n" 271 " \"make_chrome_default\": true,\n"
272 " \"make_chrome_default_for_user\": true,\n"
271 " \"system_level\": true,\n" 273 " \"system_level\": true,\n"
272 " \"verbose_logging\": true,\n" 274 " \"verbose_logging\": true,\n"
273 " \"require_eula\": true,\n" 275 " \"require_eula\": true,\n"
274 " \"alternate_shortcut_text\": true\n" 276 " \"alternate_shortcut_text\": true\n"
275 "},\n" 277 "},\n"
276 " \"blah\": {\n" 278 " \"blah\": {\n"
277 " \"import_history\": false\n" 279 " \"import_history\": false\n"
278 " }\n" 280 " }\n"
279 "} \n"; 281 "} \n";
280 282
281 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text))); 283 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text)));
282 int result = installer_util::ParseDistributionPreferences(prefs); 284 int result = installer_util::ParseDistributionPreferences(prefs);
283 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_NOT_FOUND); 285 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_NOT_FOUND);
284 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_ERROR); 286 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_ERROR);
285 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_NO_FIRST_RUN_UI); 287 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_NO_FIRST_RUN_UI);
286 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SHOW_WELCOME); 288 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SHOW_WELCOME);
287 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE); 289 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE);
288 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_HISTORY); 290 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_HISTORY);
291 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_BOOKMARKS);
289 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_CREATE_ALL_SHORTCUTS); 292 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_CREATE_ALL_SHORTCUTS);
290 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_DO_NOT_LAUNCH_CHROME); 293 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_DO_NOT_LAUNCH_CHROME);
291 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT); 294 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT);
295 EXPECT_TRUE(result &
296 installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER);
292 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SYSTEM_LEVEL); 297 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SYSTEM_LEVEL);
293 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_VERBOSE_LOGGING); 298 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_VERBOSE_LOGGING);
294 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_REQUIRE_EULA); 299 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_REQUIRE_EULA);
295 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_ALT_SHORTCUT_TXT); 300 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_ALT_SHORTCUT_TXT);
296 EXPECT_TRUE(file_util::Delete(prefs, false)); 301 EXPECT_TRUE(file_util::Delete(prefs, false));
297 } 302 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run.cc ('k') | chrome/installer/util/master_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698