| 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 "base/json/json_file_value_serializer.h" | 5 #include "base/json/json_file_value_serializer.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "chrome/browser/extensions/extension_info_map.h" | 8 #include "chrome/browser/extensions/extension_info_map.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 11 #include "chrome/common/extensions/extension_manifest_constants.h" | |
| 12 #include "content/public/test/test_browser_thread.h" | 11 #include "content/public/test/test_browser_thread.h" |
| 12 #include "extensions/common/manifest_constants.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 using content::BrowserThread; | 15 using content::BrowserThread; |
| 16 using extensions::APIPermission; | 16 using extensions::APIPermission; |
| 17 using extensions::Extension; | 17 using extensions::Extension; |
| 18 using extensions::Manifest; | 18 using extensions::Manifest; |
| 19 | 19 |
| 20 namespace keys = extension_manifest_keys; | 20 namespace keys = extensions::manifest_keys; |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 class ExtensionInfoMapTest : public testing::Test { | 24 class ExtensionInfoMapTest : public testing::Test { |
| 25 public: | 25 public: |
| 26 ExtensionInfoMapTest() | 26 ExtensionInfoMapTest() |
| 27 : ui_thread_(BrowserThread::UI, &message_loop_), | 27 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 28 io_thread_(BrowserThread::IO, &message_loop_) { | 28 io_thread_(BrowserThread::IO, &message_loop_) { |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 EXPECT_FALSE(match && | 161 EXPECT_FALSE(match && |
| 162 match->HasAPIPermission(APIPermission::kNotification)); | 162 match->HasAPIPermission(APIPermission::kNotification)); |
| 163 | 163 |
| 164 // Random URL should not have any permissions. | 164 // Random URL should not have any permissions. |
| 165 GURL evil_url("http://evil.com/a.html"); | 165 GURL evil_url("http://evil.com/a.html"); |
| 166 match = info_map->extensions().GetExtensionOrAppByURL(evil_url); | 166 match = info_map->extensions().GetExtensionOrAppByURL(evil_url); |
| 167 EXPECT_FALSE(match); | 167 EXPECT_FALSE(match); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace | 170 } // namespace |
| OLD | NEW |