OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/glue/chrome_extensions_activity_monitor.h" | 5 #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 public: | 63 public: |
64 SyncChromeExtensionsActivityMonitorTest() | 64 SyncChromeExtensionsActivityMonitorTest() |
65 : ui_thread_(BrowserThread::UI, &ui_loop_), | 65 : ui_thread_(BrowserThread::UI, &ui_loop_), |
66 extension1_(MakeExtension("extension1")), | 66 extension1_(MakeExtension("extension1")), |
67 extension2_(MakeExtension("extension2")), | 67 extension2_(MakeExtension("extension2")), |
68 id1_(extension1_->id()), | 68 id1_(extension1_->id()), |
69 id2_(extension2_->id()) {} | 69 id2_(extension2_->id()) {} |
70 virtual ~SyncChromeExtensionsActivityMonitorTest() {} | 70 virtual ~SyncChromeExtensionsActivityMonitorTest() {} |
71 | 71 |
72 private: | 72 private: |
73 MessageLoop ui_loop_; | 73 base::MessageLoop ui_loop_; |
74 content::TestBrowserThread ui_thread_; | 74 content::TestBrowserThread ui_thread_; |
75 | 75 |
76 protected: | 76 protected: |
77 ChromeExtensionsActivityMonitor monitor_; | 77 ChromeExtensionsActivityMonitor monitor_; |
78 scoped_refptr<Extension> extension1_; | 78 scoped_refptr<Extension> extension1_; |
79 scoped_refptr<Extension> extension2_; | 79 scoped_refptr<Extension> extension2_; |
80 // IDs of |extension{1,2}_|. | 80 // IDs of |extension{1,2}_|. |
81 const std::string& id1_; | 81 const std::string& id1_; |
82 const std::string& id2_; | 82 const std::string& id2_; |
83 }; | 83 }; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 FireBookmarksApiEvent<extensions::BookmarksCreateFunction>(extension1_, 3); | 165 FireBookmarksApiEvent<extensions::BookmarksCreateFunction>(extension1_, 3); |
166 monitor_.GetAndClearRecords(&results); | 166 monitor_.GetAndClearRecords(&results); |
167 | 167 |
168 EXPECT_EQ(1U, results.size()); | 168 EXPECT_EQ(1U, results.size()); |
169 EXPECT_EQ(3U, results[id1_].bookmark_write_count); | 169 EXPECT_EQ(3U, results[id1_].bookmark_write_count); |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 | 173 |
174 } // namespace browser_sync | 174 } // namespace browser_sync |
OLD | NEW |