| 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/browser/extensions/extension_service_unittest.h" | 5 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 ValidateIntegerPref(good1, "state", Extension::ENABLED); | 1050 ValidateIntegerPref(good1, "state", Extension::ENABLED); |
| 1051 ValidateIntegerPref(good1, "location", Extension::INTERNAL); | 1051 ValidateIntegerPref(good1, "location", Extension::INTERNAL); |
| 1052 ValidateIntegerPref(good2, "state", Extension::ENABLED); | 1052 ValidateIntegerPref(good2, "state", Extension::ENABLED); |
| 1053 ValidateIntegerPref(good2, "location", Extension::INTERNAL); | 1053 ValidateIntegerPref(good2, "location", Extension::INTERNAL); |
| 1054 | 1054 |
| 1055 URLPatternSet expected_patterns; | 1055 URLPatternSet expected_patterns; |
| 1056 AddPattern(&expected_patterns, "file:///*"); | 1056 AddPattern(&expected_patterns, "file:///*"); |
| 1057 AddPattern(&expected_patterns, "http://*.google.com/*"); | 1057 AddPattern(&expected_patterns, "http://*.google.com/*"); |
| 1058 AddPattern(&expected_patterns, "https://*.google.com/*"); | 1058 AddPattern(&expected_patterns, "https://*.google.com/*"); |
| 1059 const Extension* extension = loaded_[0]; | 1059 const Extension* extension = loaded_[0]; |
| 1060 const UserScriptList& scripts = extension->content_scripts(); | 1060 const extensions::UserScriptList& scripts = extension->content_scripts(); |
| 1061 ASSERT_EQ(2u, scripts.size()); | 1061 ASSERT_EQ(2u, scripts.size()); |
| 1062 EXPECT_EQ(expected_patterns, scripts[0].url_patterns()); | 1062 EXPECT_EQ(expected_patterns, scripts[0].url_patterns()); |
| 1063 EXPECT_EQ(2u, scripts[0].js_scripts().size()); | 1063 EXPECT_EQ(2u, scripts[0].js_scripts().size()); |
| 1064 ExtensionResource resource00(extension->id(), | 1064 ExtensionResource resource00(extension->id(), |
| 1065 scripts[0].js_scripts()[0].extension_root(), | 1065 scripts[0].js_scripts()[0].extension_root(), |
| 1066 scripts[0].js_scripts()[0].relative_path()); | 1066 scripts[0].js_scripts()[0].relative_path()); |
| 1067 FilePath expected_path(extension->path().AppendASCII("script1.js")); | 1067 FilePath expected_path(extension->path().AppendASCII("script1.js")); |
| 1068 ASSERT_TRUE(file_util::AbsolutePath(&expected_path)); | 1068 ASSERT_TRUE(file_util::AbsolutePath(&expected_path)); |
| 1069 EXPECT_TRUE(resource00.ComparePathWithDefault(expected_path)); | 1069 EXPECT_TRUE(resource00.ComparePathWithDefault(expected_path)); |
| 1070 ExtensionResource resource01(extension->id(), | 1070 ExtensionResource resource01(extension->id(), |
| (...skipping 4164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5235 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", | 5235 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", |
| 5236 data_dir_.AppendASCII("hosted_app.crx")); | 5236 data_dir_.AppendASCII("hosted_app.crx")); |
| 5237 | 5237 |
| 5238 service_->CheckForExternalUpdates(); | 5238 service_->CheckForExternalUpdates(); |
| 5239 loop_.RunAllPending(); | 5239 loop_.RunAllPending(); |
| 5240 | 5240 |
| 5241 ASSERT_TRUE(service_->PopulateExtensionGlobalError( | 5241 ASSERT_TRUE(service_->PopulateExtensionGlobalError( |
| 5242 extension_global_error.get())); | 5242 extension_global_error.get())); |
| 5243 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); | 5243 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); |
| 5244 } | 5244 } |
| OLD | NEW |