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

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

Issue 155063: Merge r18210.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 years, 5 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 " \"import_bookmarks\": true,\n"
269 " \"import_home_page\": true,\n"
269 " \"create_all_shortcuts\": true,\n" 270 " \"create_all_shortcuts\": true,\n"
270 " \"do_not_launch_chrome\": true,\n" 271 " \"do_not_launch_chrome\": true,\n"
271 " \"make_chrome_default\": true,\n" 272 " \"make_chrome_default\": true,\n"
272 " \"make_chrome_default_for_user\": true,\n" 273 " \"make_chrome_default_for_user\": true,\n"
273 " \"system_level\": true,\n" 274 " \"system_level\": true,\n"
274 " \"verbose_logging\": true,\n" 275 " \"verbose_logging\": true,\n"
275 " \"require_eula\": true,\n" 276 " \"require_eula\": true,\n"
276 " \"alternate_shortcut_text\": true\n" 277 " \"alternate_shortcut_text\": true\n"
277 "},\n" 278 "},\n"
278 " \"blah\": {\n" 279 " \"blah\": {\n"
279 " \"import_history\": false\n" 280 " \"import_history\": false\n"
280 " }\n" 281 " }\n"
281 "} \n"; 282 "} \n";
282 283
283 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text))); 284 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text)));
284 int result = installer_util::ParseDistributionPreferences(prefs); 285 int result = installer_util::ParseDistributionPreferences(prefs);
285 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_NOT_FOUND); 286 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_NOT_FOUND);
286 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_ERROR); 287 EXPECT_FALSE(result & installer_util::MASTER_PROFILE_ERROR);
287 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_NO_FIRST_RUN_UI); 288 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_NO_FIRST_RUN_UI);
288 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SHOW_WELCOME); 289 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SHOW_WELCOME);
289 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE); 290 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_SEARCH_ENGINE);
290 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_HISTORY); 291 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_HISTORY);
291 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_BOOKMARKS); 292 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_BOOKMARKS);
293 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_IMPORT_HOME_PAGE);
292 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_CREATE_ALL_SHORTCUTS); 294 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_CREATE_ALL_SHORTCUTS);
293 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_DO_NOT_LAUNCH_CHROME); 295 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_DO_NOT_LAUNCH_CHROME);
294 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT); 296 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT);
295 EXPECT_TRUE(result & 297 EXPECT_TRUE(result &
296 installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER); 298 installer_util::MASTER_PROFILE_MAKE_CHROME_DEFAULT_FOR_USER);
297 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SYSTEM_LEVEL); 299 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_SYSTEM_LEVEL);
298 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_VERBOSE_LOGGING); 300 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_VERBOSE_LOGGING);
299 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_REQUIRE_EULA); 301 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_REQUIRE_EULA);
300 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_ALT_SHORTCUT_TXT); 302 EXPECT_TRUE(result & installer_util::MASTER_PROFILE_ALT_SHORTCUT_TXT);
301 EXPECT_TRUE(file_util::Delete(prefs, false)); 303 EXPECT_TRUE(file_util::Delete(prefs, false));
(...skipping 16 matching lines...) Expand all
318 320
319 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text))); 321 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text)));
320 typedef std::vector<std::wstring> TabsVector; 322 typedef std::vector<std::wstring> TabsVector;
321 TabsVector tabs = installer_util::ParseFirstRunTabs(prefs); 323 TabsVector tabs = installer_util::ParseFirstRunTabs(prefs);
322 ASSERT_EQ(3, tabs.size()); 324 ASSERT_EQ(3, tabs.size());
323 EXPECT_EQ(L"http://google.com/f1", tabs[0]); 325 EXPECT_EQ(L"http://google.com/f1", tabs[0]);
324 EXPECT_EQ(L"https://google.com/f2", tabs[1]); 326 EXPECT_EQ(L"https://google.com/f2", tabs[1]);
325 EXPECT_EQ(L"new_tab_page", tabs[2]); 327 EXPECT_EQ(L"new_tab_page", tabs[2]);
326 EXPECT_TRUE(file_util::Delete(prefs, false)); 328 EXPECT_TRUE(file_util::Delete(prefs, false));
327 } 329 }
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