OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_management.h" | 5 #include "chrome/browser/extensions/extension_management.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 " \"update_url\": \"http://example.com/update_url\"," | 55 " \"update_url\": \"http://example.com/update_url\"," |
56 " \"blocked_permissions\": [\"downloads\"]," | 56 " \"blocked_permissions\": [\"downloads\"]," |
57 " }," | 57 " }," |
58 " \"cdefghijklmnopabcdefghijklmnopab\": {" // kTargetExtension3 | 58 " \"cdefghijklmnopabcdefghijklmnopab\": {" // kTargetExtension3 |
59 " \"installation_mode\": \"normal_installed\"," | 59 " \"installation_mode\": \"normal_installed\"," |
60 " \"update_url\": \"http://example.com/update_url\"," | 60 " \"update_url\": \"http://example.com/update_url\"," |
61 " \"blocked_permissions\": [\"fileSystem\", \"history\"]," | 61 " \"blocked_permissions\": [\"fileSystem\", \"history\"]," |
62 " }," | 62 " }," |
63 " \"defghijklmnopabcdefghijklmnopabc\": {" // kTargetExtension4 | 63 " \"defghijklmnopabcdefghijklmnopabc\": {" // kTargetExtension4 |
64 " \"installation_mode\": \"blocked\"," | 64 " \"installation_mode\": \"blocked\"," |
65 " \"runtime_blocked_hosts\": [\"*://*.foo.com/*\", " | 65 " \"runtime_blocked_hosts\": [\"*://*.foo.com\", " |
66 "\"https://bar.org/test\"]," | 66 "\"https://bar.org/test\"]," |
67 " \"blocked_install_message\": \"Custom Error Extension4\"," | 67 " \"blocked_install_message\": \"Custom Error Extension4\"," |
68 " }," | 68 " }," |
69 " \"jdkrmdirkjskemfioeesiofoielsmroi\": {" // kTargetExtension5 | 69 " \"jdkrmdirkjskemfioeesiofoielsmroi\": {" // kTargetExtension5 |
70 " \"installation_mode\": \"normal_installed\"," | 70 " \"installation_mode\": \"normal_installed\"," |
71 " }," | 71 " }," |
72 " \"update_url:http://example.com/update_url\": {" // kExampleUpdateUrl | 72 " \"update_url:http://example.com/update_url\": {" // kExampleUpdateUrl |
73 " \"installation_mode\": \"allowed\"," | 73 " \"installation_mode\": \"allowed\"," |
74 " \"blocked_permissions\": [\"fileSystem\", \"bookmarks\"]," | 74 " \"blocked_permissions\": [\"fileSystem\", \"bookmarks\"]," |
75 " }," | 75 " }," |
76 " \"*\": {" | 76 " \"*\": {" |
77 " \"installation_mode\": \"blocked\"," | 77 " \"installation_mode\": \"blocked\"," |
78 " \"install_sources\": [\"*://foo.com/*\"]," | 78 " \"install_sources\": [\"*://foo.com/*\"]," |
79 " \"allowed_types\": [\"theme\", \"user_script\"]," | 79 " \"allowed_types\": [\"theme\", \"user_script\"]," |
80 " \"blocked_permissions\": [\"fileSystem\", \"downloads\"]," | 80 " \"blocked_permissions\": [\"fileSystem\", \"downloads\"]," |
81 " \"runtime_blocked_hosts\": [\"*://*.example.com/default*\"]," | 81 " \"runtime_blocked_hosts\": [\"*://*.example.com\"]," |
82 " \"blocked_install_message\": \"Custom Error Default\"," | 82 " \"blocked_install_message\": \"Custom Error Default\"," |
83 " }," | 83 " }," |
84 "}"; | 84 "}"; |
85 | 85 |
86 const char kExampleDictNoCustomError[] = | 86 const char kExampleDictNoCustomError[] = |
87 "{" | 87 "{" |
88 " \"*\": {" | 88 " \"*\": {" |
89 " \"installation_mode\": \"blocked\"," | 89 " \"installation_mode\": \"blocked\"," |
90 " }," | 90 " }," |
91 "}"; | 91 "}"; |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 EXPECT_FALSE(error.empty()); | 936 EXPECT_FALSE(error.empty()); |
937 | 937 |
938 CreateExtension(Manifest::INTERNAL); | 938 CreateExtension(Manifest::INTERNAL); |
939 error.clear(); | 939 error.clear(); |
940 EXPECT_FALSE(MustRemainEnabled(extension_.get(), NULL)); | 940 EXPECT_FALSE(MustRemainEnabled(extension_.get(), NULL)); |
941 EXPECT_FALSE(MustRemainEnabled(extension_.get(), &error)); | 941 EXPECT_FALSE(MustRemainEnabled(extension_.get(), &error)); |
942 EXPECT_TRUE(error.empty()); | 942 EXPECT_TRUE(error.empty()); |
943 } | 943 } |
944 | 944 |
945 } // namespace extensions | 945 } // namespace extensions |
OLD | NEW |