| OLD | NEW |
| 1 // Copyright (c) 2009 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 entry. | 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/waitable_event.h" | 9 #include "base/waitable_event.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| 11 #include "chrome/browser/extensions/extension_bookmarks_module.h" | 11 #include "chrome/browser/extensions/extension_bookmarks_module.h" |
| 12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
| 13 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
| 14 #include "chrome/common/notification_service.h" | 14 #include "chrome/common/notification_service.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 using browser_sync::ExtensionsActivityMonitor; | 17 using browser_sync::ExtensionsActivityMonitor; |
| 18 namespace keys = extension_manifest_keys; | 18 namespace keys = extension_manifest_keys; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 const FilePath::CharType kTestExtensionPath1[] = | 22 const FilePath::CharType kTestExtensionPath1[] = |
| 23 #if defined(OS_POSIX) | 23 #if defined(OS_POSIX) |
| 24 FILE_PATH_LITERAL("/testextension1"); | 24 FILE_PATH_LITERAL("/testextension1"); |
| 25 #elif defined(OS_WIN) | 25 #elif defined(OS_WIN) |
| 26 FILE_PATH_LITERAL("c:\\testextension1"); | 26 FILE_PATH_LITERAL("c:\\testextension1"); |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 const FilePath::CharType kTestExtensionPath2[] = | 29 const FilePath::CharType kTestExtensionPath2[] = |
| 30 #if defined(OS_POSIX) | 30 #if defined(OS_POSIX) |
| 31 FILE_PATH_LITERAL("/testextension2"); | 31 FILE_PATH_LITERAL("/testextension2"); |
| 32 #elif defined(OS_WIN) | 32 #elif defined(OS_WIN) |
| 33 FILE_PATH_LITERAL("c:\\testextension2"); | 33 FILE_PATH_LITERAL("c:\\testextension2"); |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 const char* kTestExtensionVersion = "1.0.0.0"; | 36 const char* kTestExtensionVersion = "1.0.0.0"; |
| 37 const char* kTestExtensionName = "foo extension"; | 37 const char* kTestExtensionName = "foo extension"; |
| 38 | 38 |
| 39 template <class FunctionType> | 39 template <class FunctionType> |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 generator.NewEvent<CreateBookmarkFunction>(kTestExtensionPath1, | 239 generator.NewEvent<CreateBookmarkFunction>(kTestExtensionPath1, |
| 240 new CreateBookmarkFunction(), 3); | 240 new CreateBookmarkFunction(), 3); |
| 241 monitor->GetAndClearRecords(&results); | 241 monitor->GetAndClearRecords(&results); |
| 242 | 242 |
| 243 EXPECT_EQ(1U, results.size()); | 243 EXPECT_EQ(1U, results.size()); |
| 244 EXPECT_EQ(3U, results[id1].bookmark_write_count); | 244 EXPECT_EQ(3U, results[id1].bookmark_write_count); |
| 245 | 245 |
| 246 ui_loop()->DeleteSoon(FROM_HERE, monitor); | 246 ui_loop()->DeleteSoon(FROM_HERE, monitor); |
| 247 } | 247 } |
| OLD | NEW |