diff options
Diffstat (limited to 'chrome/browser/sync/glue')
-rw-r--r-- | chrome/browser/sync/glue/chrome_extensions_activity_monitor.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc | 36 |
2 files changed, 22 insertions, 20 deletions
diff --git a/chrome/browser/sync/glue/chrome_extensions_activity_monitor.cc b/chrome/browser/sync/glue/chrome_extensions_activity_monitor.cc index 17ec604..1c6d472 100644 --- a/chrome/browser/sync/glue/chrome_extensions_activity_monitor.cc +++ b/chrome/browser/sync/glue/chrome_extensions_activity_monitor.cc @@ -5,7 +5,7 @@ #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" #include "base/bind.h" -#include "chrome/browser/bookmarks/bookmark_extension_api.h" +#include "chrome/browser/extensions/api/bookmarks/bookmark_api.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" #include "content/public/browser/browser_thread.h" @@ -53,8 +53,8 @@ void ChromeExtensionsActivityMonitor::Observe( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); const extensions::Extension* extension = content::Source<const extensions::Extension>(source).ptr(); - const BookmarksFunction* f = - content::Details<const BookmarksFunction>(details).ptr(); + const extensions::BookmarksFunction* f = + content::Details<const extensions::BookmarksFunction>(details).ptr(); if (f->name() == "bookmarks.update" || f->name() == "bookmarks.move" || f->name() == "bookmarks.create" || diff --git a/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc index 08d693d..f03e231 100644 --- a/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc @@ -8,7 +8,7 @@ #include "base/message_loop.h" #include "base/path_service.h" #include "base/values.h" -#include "chrome/browser/bookmarks/bookmark_extension_api.h" +#include "chrome/browser/extensions/api/bookmarks/bookmark_api.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" @@ -53,7 +53,8 @@ void FireBookmarksApiEvent( content::NotificationService::current()->Notify( chrome::NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED, content::Source<Extension>(extension.get()), - content::Details<const BookmarksFunction>(bookmarks_function.get())); + content::Details<const extensions::BookmarksFunction>( + bookmarks_function.get())); } } @@ -85,17 +86,18 @@ class SyncChromeExtensionsActivityMonitorTest : public testing::Test { // 2. Only the mutating events should be recorded by the // syncer::ExtensionsActivityMonitor. TEST_F(SyncChromeExtensionsActivityMonitorTest, Basic) { - FireBookmarksApiEvent<RemoveBookmarkFunction>(extension1_, 1); - FireBookmarksApiEvent<MoveBookmarkFunction>(extension1_, 1); - FireBookmarksApiEvent<UpdateBookmarkFunction>(extension1_, 2); - FireBookmarksApiEvent<CreateBookmarkFunction>(extension1_, 3); - FireBookmarksApiEvent<SearchBookmarksFunction>(extension1_, 5); + FireBookmarksApiEvent<extensions::RemoveBookmarkFunction>(extension1_, 1); + FireBookmarksApiEvent<extensions::MoveBookmarkFunction>(extension1_, 1); + FireBookmarksApiEvent<extensions::UpdateBookmarkFunction>(extension1_, 2); + FireBookmarksApiEvent<extensions::CreateBookmarkFunction>(extension1_, 3); + FireBookmarksApiEvent<extensions::SearchBookmarksFunction>(extension1_, 5); const uint32 writes_by_extension1 = 1 + 1 + 2 + 3; - FireBookmarksApiEvent<RemoveTreeBookmarkFunction>(extension2_, 8); - FireBookmarksApiEvent<GetBookmarkTreeFunction>(extension2_, 13); - FireBookmarksApiEvent<GetBookmarkChildrenFunction>(extension2_, 21); - FireBookmarksApiEvent<GetBookmarksFunction>(extension2_, 33); + FireBookmarksApiEvent<extensions::RemoveTreeBookmarkFunction>(extension2_, 8); + FireBookmarksApiEvent<extensions::GetBookmarkTreeFunction>(extension2_, 13); + FireBookmarksApiEvent<extensions::GetBookmarkChildrenFunction>( + extension2_, 21); + FireBookmarksApiEvent<extensions::GetBookmarksFunction>(extension2_, 33); const uint32 writes_by_extension2 = 8; syncer::ExtensionsActivityMonitor::Records results; @@ -113,8 +115,8 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Basic) { // and put the old records back. Those should be merged with the new // records correctly. TEST_F(SyncChromeExtensionsActivityMonitorTest, Put) { - FireBookmarksApiEvent<CreateBookmarkFunction>(extension1_, 5); - FireBookmarksApiEvent<MoveBookmarkFunction>(extension2_, 8); + FireBookmarksApiEvent<extensions::CreateBookmarkFunction>(extension1_, 5); + FireBookmarksApiEvent<extensions::MoveBookmarkFunction>(extension2_, 8); syncer::ExtensionsActivityMonitor::Records results; monitor_.GetAndClearRecords(&results); @@ -123,8 +125,8 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Put) { EXPECT_EQ(5U, results[id1_].bookmark_write_count); EXPECT_EQ(8U, results[id2_].bookmark_write_count); - FireBookmarksApiEvent<GetBookmarksFunction>(extension2_, 3); - FireBookmarksApiEvent<UpdateBookmarkFunction>(extension2_, 2); + FireBookmarksApiEvent<extensions::GetBookmarksFunction>(extension2_, 3); + FireBookmarksApiEvent<extensions::UpdateBookmarkFunction>(extension2_, 2); // Simulate a commit failure, which augments the active record set with the // refugee records. @@ -143,7 +145,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, Put) { // times. The mintor should correctly clear its records every time // they're returned. TEST_F(SyncChromeExtensionsActivityMonitorTest, MultiGet) { - FireBookmarksApiEvent<CreateBookmarkFunction>(extension1_, 5); + FireBookmarksApiEvent<extensions::CreateBookmarkFunction>(extension1_, 5); syncer::ExtensionsActivityMonitor::Records results; monitor_.GetAndClearRecords(&results); @@ -154,7 +156,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, MultiGet) { monitor_.GetAndClearRecords(&results); EXPECT_TRUE(results.empty()); - FireBookmarksApiEvent<CreateBookmarkFunction>(extension1_, 3); + FireBookmarksApiEvent<extensions::CreateBookmarkFunction>(extension1_, 3); monitor_.GetAndClearRecords(&results); EXPECT_EQ(1U, results.size()); |