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

Side by Side Diff: chrome/browser/component_updater/component_updater_service_unittest.cc

Issue 7565002: Fix memory errors in ComponentUpdater::ComponentUpdater(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/component_updater/component_updater_service.h" 5 #include "chrome/browser/component_updater/component_updater_service.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/values.h"
11 #include "chrome/browser/component_updater/component_updater_interceptor.h" 12 #include "chrome/browser/component_updater/component_updater_interceptor.h"
12 #include "chrome/common/chrome_paths.h" 13 #include "chrome/common/chrome_paths.h"
13 #include "chrome/common/chrome_notification_types.h" 14 #include "chrome/common/chrome_notification_types.h"
14 #include "chrome/test/base/test_notification_tracker.h" 15 #include "chrome/test/base/test_notification_tracker.h"
15 #include "chrome/test/base/test_url_request_context_getter.h" 16 #include "chrome/test/base/test_url_request_context_getter.h"
16 #include "chrome/test/testing_browser_process_test.h" 17 #include "chrome/test/testing_browser_process_test.h"
17 #include "content/browser/browser_thread.h" 18 #include "content/browser/browser_thread.h"
18 #include "content/common/notification_observer.h" 19 #include "content/common/notification_observer.h"
19 #include "content/common/notification_service.h" 20 #include "content/common/notification_service.h"
20 #include "content/common/url_fetcher.h" 21 #include "content/common/url_fetcher.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 68 }
68 69
69 virtual void OnUpdateError(int error) OVERRIDE { 70 virtual void OnUpdateError(int error) OVERRIDE {
70 EXPECT_NE(0, error); 71 EXPECT_NE(0, error);
71 error_ = error; 72 error_ = error;
72 } 73 }
73 74
74 virtual bool Install(base::DictionaryValue* manifest, 75 virtual bool Install(base::DictionaryValue* manifest,
75 const FilePath& unpack_path) OVERRIDE { 76 const FilePath& unpack_path) OVERRIDE {
76 ++install_count_; 77 ++install_count_;
78 delete manifest;
77 return file_util::Delete(unpack_path, true); 79 return file_util::Delete(unpack_path, true);
78 } 80 }
79 81
80 int error() const { return error_; } 82 int error() const { return error_; }
81 83
82 int install_count() const { return install_count_; } 84 int install_count() const { return install_count_; }
83 85
84 private: 86 private:
85 int error_; 87 int error_;
86 int install_count_; 88 int install_count_;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev3.type); 287 EXPECT_EQ(chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, ev3.type);
286 288
287 EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->error()); 289 EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->error());
288 EXPECT_EQ(1, static_cast<TestInstaller*>(com1.installer)->install_count()); 290 EXPECT_EQ(1, static_cast<TestInstaller*>(com1.installer)->install_count());
289 291
290 component_updater()->Stop(); 292 component_updater()->Stop();
291 delete com1.installer; 293 delete com1.installer;
292 delete com2.installer; 294 delete com2.installer;
293 xmlCleanupGlobals(); 295 xmlCleanupGlobals();
294 } 296 }
295
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/component_unpacker.cc ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698