| 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/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.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/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 { "devtools", true }, | 590 { "devtools", true }, |
| 591 { "extension", true }, | 591 { "extension", true }, |
| 592 { "i18n", true }, | 592 { "i18n", true }, |
| 593 { "pageAction", true }, | 593 { "pageAction", true }, |
| 594 { "pageActions", true }, | 594 { "pageActions", true }, |
| 595 { "test", true }, | 595 { "test", true }, |
| 596 // Some negative tests. | 596 // Some negative tests. |
| 597 { "bookmarks", false }, | 597 { "bookmarks", false }, |
| 598 { "cookies", false }, | 598 { "cookies", false }, |
| 599 { "history", false }, | 599 { "history", false }, |
| 600 { "tabs.onUpdated", false }, | |
| 601 // Make sure we find the module name after stripping '.' and '/'. | 600 // Make sure we find the module name after stripping '.' and '/'. |
| 602 { "browserAction/abcd/onClick", true }, | 601 { "browserAction/abcd/onClick", true }, |
| 603 { "browserAction.abcd.onClick", true }, | 602 { "browserAction.abcd.onClick", true }, |
| 604 // Test Tabs functions. | 603 // Test Tabs functions. |
| 605 { "tabs.create", true}, | 604 { "tabs.create", true}, |
| 606 { "tabs.onRemoved", true}, | 605 { "tabs.onRemoved", true}, |
| 607 { "tabs.remove", true}, | 606 { "tabs.remove", true}, |
| 608 { "tabs.update", true}, | 607 { "tabs.update", true}, |
| 609 { "tabs.getSelected", false}, | 608 { "tabs.getSelected", true}, |
| 609 { "tabs.onUpdated", true }, |
| 610 // Test getPermissionWarnings functions. Only one requires permissions. | 610 // Test getPermissionWarnings functions. Only one requires permissions. |
| 611 { "management.getPermissionWarningsById", false }, | 611 { "management.getPermissionWarningsById", false }, |
| 612 { "management.getPermissionWarningsByManifest", true }, | 612 { "management.getPermissionWarningsByManifest", true }, |
| 613 }; | 613 }; |
| 614 | 614 |
| 615 scoped_refptr<Extension> extension; | 615 scoped_refptr<Extension> extension; |
| 616 extension = LoadManifest("empty_manifest", "empty.json"); | 616 extension = LoadManifest("empty_manifest", "empty.json"); |
| 617 | 617 |
| 618 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { | 618 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { |
| 619 EXPECT_EQ(kTests[i].expect_success, | 619 EXPECT_EQ(kTests[i].expect_success, |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 | 1207 |
| 1208 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { | 1208 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { |
| 1209 scoped_refptr<Extension> extension( | 1209 scoped_refptr<Extension> extension( |
| 1210 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 1210 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 1211 Extension::INTERNAL, 2, FilePath(), | 1211 Extension::INTERNAL, 2, FilePath(), |
| 1212 Extension::NO_FLAGS)); | 1212 Extension::NO_FLAGS)); |
| 1213 if (extension) | 1213 if (extension) |
| 1214 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); | 1214 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); |
| 1215 } | 1215 } |
| 1216 #endif // !defined(OS_CHROMEOS) | 1216 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |