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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "extensions/common/error_utils.h" | 7 #include "extensions/common/error_utils.h" |
8 #include "extensions/common/manifest_constants.h" | 8 #include "extensions/common/manifest_constants.h" |
9 #include "extensions/common/manifest_handlers/externally_connectable.h" | 9 #include "extensions/common/manifest_handlers/externally_connectable.h" |
10 #include "extensions/common/manifest_test.h" | 10 #include "extensions/common/manifest_test.h" |
11 #include "extensions/common/permissions/permissions_data.h" | 11 #include "extensions/common/permissions/permissions_data.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 using testing::ElementsAre; | 15 using testing::ElementsAre; |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 namespace errors = externally_connectable_errors; | 19 namespace errors = externally_connectable_errors; |
20 | 20 |
21 class ExternallyConnectableTest : public ManifestTest { | 21 class ExternallyConnectableTest : public ManifestTest { |
22 public: | 22 public: |
23 ExternallyConnectableTest() {} | 23 ExternallyConnectableTest() {} |
24 virtual ~ExternallyConnectableTest() {} | 24 ~ExternallyConnectableTest() override {} |
25 | 25 |
26 protected: | 26 protected: |
27 ExternallyConnectableInfo* GetExternallyConnectableInfo( | 27 ExternallyConnectableInfo* GetExternallyConnectableInfo( |
28 scoped_refptr<Extension> extension) { | 28 scoped_refptr<Extension> extension) { |
29 return static_cast<ExternallyConnectableInfo*>( | 29 return static_cast<ExternallyConnectableInfo*>( |
30 extension->GetManifestData(manifest_keys::kExternallyConnectable)); | 30 extension->GetManifestData(manifest_keys::kExternallyConnectable)); |
31 } | 31 } |
32 }; | 32 }; |
33 | 33 |
34 TEST_F(ExternallyConnectableTest, IDsAndMatches) { | 34 TEST_F(ExternallyConnectableTest, IDsAndMatches) { |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 EXPECT_TRUE(info->matches.MatchesURL(GURL("https://example.com"))); | 328 EXPECT_TRUE(info->matches.MatchesURL(GURL("https://example.com"))); |
329 EXPECT_TRUE(info->matches.MatchesURL(GURL("http://build.chromium.org"))); | 329 EXPECT_TRUE(info->matches.MatchesURL(GURL("http://build.chromium.org"))); |
330 } | 330 } |
331 | 331 |
332 TEST_F(ExternallyConnectableTest, WarningNothingSpecified) { | 332 TEST_F(ExternallyConnectableTest, WarningNothingSpecified) { |
333 LoadAndExpectWarning("externally_connectable_nothing_specified.json", | 333 LoadAndExpectWarning("externally_connectable_nothing_specified.json", |
334 errors::kErrorNothingSpecified); | 334 errors::kErrorNothingSpecified); |
335 } | 335 } |
336 | 336 |
337 } // namespace extensions | 337 } // namespace extensions |
OLD | NEW |