| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 { "devtools", true }, | 542 { "devtools", true }, |
| 543 { "extension", true }, | 543 { "extension", true }, |
| 544 { "i18n", true }, | 544 { "i18n", true }, |
| 545 { "pageAction", true }, | 545 { "pageAction", true }, |
| 546 { "pageActions", true }, | 546 { "pageActions", true }, |
| 547 { "test", true }, | 547 { "test", true }, |
| 548 // Some negative tests. | 548 // Some negative tests. |
| 549 { "bookmarks", false }, | 549 { "bookmarks", false }, |
| 550 { "cookies", false }, | 550 { "cookies", false }, |
| 551 { "history", false }, | 551 { "history", false }, |
| 552 { "tabs.onUpdated", false }, | |
| 553 // Make sure we find the module name after stripping '.' and '/'. | 552 // Make sure we find the module name after stripping '.' and '/'. |
| 554 { "browserAction/abcd/onClick", true }, | 553 { "browserAction/abcd/onClick", true }, |
| 555 { "browserAction.abcd.onClick", true }, | 554 { "browserAction.abcd.onClick", true }, |
| 556 // Test Tabs functions. | 555 // Test Tabs functions. |
| 557 { "tabs.create", true}, | 556 { "tabs.create", true}, |
| 558 { "tabs.onRemoved", true}, | 557 { "tabs.onRemoved", true}, |
| 559 { "tabs.remove", true}, | 558 { "tabs.remove", true}, |
| 560 { "tabs.update", true}, | 559 { "tabs.update", true}, |
| 561 { "tabs.getSelected", false}, | 560 { "tabs.getSelected", true}, |
| 561 { "tabs.onUpdated", true }, |
| 562 // Test getPermissionWarnings functions. Only one requires permissions. | 562 // Test getPermissionWarnings functions. Only one requires permissions. |
| 563 { "management.getPermissionWarningsById", false }, | 563 { "management.getPermissionWarningsById", false }, |
| 564 { "management.getPermissionWarningsByManifest", true }, | 564 { "management.getPermissionWarningsByManifest", true }, |
| 565 }; | 565 }; |
| 566 | 566 |
| 567 scoped_refptr<Extension> extension; | 567 scoped_refptr<Extension> extension; |
| 568 extension = LoadManifest("empty_manifest", "empty.json"); | 568 extension = LoadManifest("empty_manifest", "empty.json"); |
| 569 | 569 |
| 570 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { | 570 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { |
| 571 EXPECT_EQ(kTests[i].expect_success, | 571 EXPECT_EQ(kTests[i].expect_success, |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { | 1113 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { |
| 1114 scoped_refptr<Extension> extension( | 1114 scoped_refptr<Extension> extension( |
| 1115 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 1115 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 1116 Extension::INTERNAL, 2, FilePath())); | 1116 Extension::INTERNAL, 2, FilePath())); |
| 1117 if (extension) | 1117 if (extension) |
| 1118 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); | 1118 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); |
| 1119 } | 1119 } |
| 1120 #endif // !defined(OS_CHROMEOS) | 1120 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |