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

Side by Side Diff: chrome/browser/sync/util/extensions_activity_monitor_unittest.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | 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/sync/util/extensions_activity_monitor.h" 5 #include "chrome/browser/sync/util/extensions_activity_monitor.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 28 matching lines...) Expand all
39 39
40 template <class FunctionType> 40 template <class FunctionType>
41 class BookmarkAPIEventTask : public Task { 41 class BookmarkAPIEventTask : public Task {
42 public: 42 public:
43 BookmarkAPIEventTask(FunctionType* t, Extension* e, size_t repeats, 43 BookmarkAPIEventTask(FunctionType* t, Extension* e, size_t repeats,
44 base::WaitableEvent* done) : 44 base::WaitableEvent* done) :
45 extension_(e), function_(t), repeats_(repeats), done_(done) {} 45 extension_(e), function_(t), repeats_(repeats), done_(done) {}
46 virtual void Run() { 46 virtual void Run() {
47 for (size_t i = 0; i < repeats_; i++) { 47 for (size_t i = 0; i < repeats_; i++) {
48 NotificationService::current()->Notify( 48 NotificationService::current()->Notify(
49 NotificationType::EXTENSION_BOOKMARKS_API_INVOKED, 49 chrome::EXTENSION_BOOKMARKS_API_INVOKED,
50 Source<Extension>(extension_.get()), 50 Source<Extension>(extension_.get()),
51 Details<const BookmarksFunction>(function_.get())); 51 Details<const BookmarksFunction>(function_.get()));
52 } 52 }
53 done_->Signal(); 53 done_->Signal();
54 } 54 }
55 private: 55 private:
56 scoped_refptr<Extension> extension_; 56 scoped_refptr<Extension> extension_;
57 scoped_refptr<FunctionType> function_; 57 scoped_refptr<FunctionType> function_;
58 size_t repeats_; 58 size_t repeats_;
59 base::WaitableEvent* done_; 59 base::WaitableEvent* done_;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 generator.NewEvent<CreateBookmarkFunction>(kTestExtensionPath1, 240 generator.NewEvent<CreateBookmarkFunction>(kTestExtensionPath1,
241 new CreateBookmarkFunction(), 3); 241 new CreateBookmarkFunction(), 3);
242 monitor->GetAndClearRecords(&results); 242 monitor->GetAndClearRecords(&results);
243 243
244 EXPECT_EQ(1U, results.size()); 244 EXPECT_EQ(1U, results.size());
245 EXPECT_EQ(3U, results[id1].bookmark_write_count); 245 EXPECT_EQ(3U, results[id1].bookmark_write_count);
246 246
247 ui_loop()->DeleteSoon(FROM_HERE, monitor); 247 ui_loop()->DeleteSoon(FROM_HERE, monitor);
248 } 248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698