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

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

Issue 151101: Fixit: Remove bunch of coverity warnings from chrome/installer/*. (Closed)
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
OLDNEW
1 // Copyright (c) 2006-2008 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 // 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"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
(...skipping 12 matching lines...) Expand all
24 virtual void SetUp() { 24 virtual void SetUp() {
25 // Currently no setup required. 25 // Currently no setup required.
26 } 26 }
27 27
28 virtual void TearDown() { 28 virtual void TearDown() {
29 // Currently no tear down required. 29 // Currently no tear down required.
30 } 30 }
31 31
32 // Creates "ap" key with the value given as parameter. Also adds work 32 // Creates "ap" key with the value given as parameter. Also adds work
33 // items to work_item_list given so that they can be rolled back later. 33 // items to work_item_list given so that they can be rolled back later.
34 bool CreateApKey(WorkItemList* work_item_list, std::wstring value) { 34 bool CreateApKey(WorkItemList* work_item_list, const std::wstring& value) {
35 HKEY reg_root = HKEY_CURRENT_USER; 35 HKEY reg_root = HKEY_CURRENT_USER;
36 std::wstring reg_key = GetApKeyPath(); 36 std::wstring reg_key = GetApKeyPath();
37 work_item_list->AddCreateRegKeyWorkItem(reg_root, reg_key); 37 work_item_list->AddCreateRegKeyWorkItem(reg_root, reg_key);
38 work_item_list->AddSetRegValueWorkItem(reg_root, reg_key, 38 work_item_list->AddSetRegValueWorkItem(reg_root, reg_key,
39 google_update::kRegApField, value.c_str(), true); 39 google_update::kRegApField, value.c_str(), true);
40 if (!work_item_list->Do()) { 40 if (!work_item_list->Do()) {
41 work_item_list->Rollback(); 41 work_item_list->Rollback();
42 return false; 42 return false;
43 } 43 }
44 return true; 44 return true;
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text))); 321 EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text)));
322 typedef std::vector<std::wstring> TabsVector; 322 typedef std::vector<std::wstring> TabsVector;
323 TabsVector tabs = installer_util::ParseFirstRunTabs(prefs); 323 TabsVector tabs = installer_util::ParseFirstRunTabs(prefs);
324 ASSERT_EQ(3, tabs.size()); 324 ASSERT_EQ(3, tabs.size());
325 EXPECT_EQ(L"http://google.com/f1", tabs[0]); 325 EXPECT_EQ(L"http://google.com/f1", tabs[0]);
326 EXPECT_EQ(L"https://google.com/f2", tabs[1]); 326 EXPECT_EQ(L"https://google.com/f2", tabs[1]);
327 EXPECT_EQ(L"new_tab_page", tabs[2]); 327 EXPECT_EQ(L"new_tab_page", tabs[2]);
328 EXPECT_TRUE(file_util::Delete(prefs, false)); 328 EXPECT_TRUE(file_util::Delete(prefs, false));
329 } 329 }
OLDNEW
« no previous file with comments | « chrome/installer/util/delete_tree_work_item.cc ('k') | chrome/installer/util/l10n_string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698