| 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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 // permissions). | 1604 // permissions). |
| 1605 host_permissions.clear(); | 1605 host_permissions.clear(); |
| 1606 current_perms = NULL; | 1606 current_perms = NULL; |
| 1607 | 1607 |
| 1608 host_permissions.insert("http://*.google.com/*"); | 1608 host_permissions.insert("http://*.google.com/*"); |
| 1609 host_permissions.insert("https://*.google.com/*"); | 1609 host_permissions.insert("https://*.google.com/*"); |
| 1610 host_permissions.insert("http://*.google.com.hk/*"); | 1610 host_permissions.insert("http://*.google.com.hk/*"); |
| 1611 | 1611 |
| 1612 ListValue* api_permissions = new ListValue(); | 1612 ListValue* api_permissions = new ListValue(); |
| 1613 api_permissions->Append( | 1613 api_permissions->Append( |
| 1614 Value::CreateIntegerValue(APIPermission::kTab)); | 1614 Value::CreateStringValue("tabs")); |
| 1615 SetPref(extension_id, "granted_permissions.api", | 1615 SetPref(extension_id, "granted_permissions.api", |
| 1616 api_permissions, "granted_permissions.api"); | 1616 api_permissions, "granted_permissions.api"); |
| 1617 SetPrefStringSet( | 1617 SetPrefStringSet( |
| 1618 extension_id, "granted_permissions.scriptable_host", host_permissions); | 1618 extension_id, "granted_permissions.scriptable_host", host_permissions); |
| 1619 | 1619 |
| 1620 service_->ReloadExtensions(); | 1620 service_->ReloadExtensions(); |
| 1621 | 1621 |
| 1622 EXPECT_EQ(1u, service_->disabled_extensions()->size()); | 1622 EXPECT_EQ(1u, service_->disabled_extensions()->size()); |
| 1623 extension = *service_->disabled_extensions()->begin(); | 1623 extension = *service_->disabled_extensions()->begin(); |
| 1624 | 1624 |
| (...skipping 3621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5246 // This should NOT trigger an alert. | 5246 // This should NOT trigger an alert. |
| 5247 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", | 5247 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", |
| 5248 data_dir_.AppendASCII("hosted_app.crx")); | 5248 data_dir_.AppendASCII("hosted_app.crx")); |
| 5249 | 5249 |
| 5250 service_->CheckForExternalUpdates(); | 5250 service_->CheckForExternalUpdates(); |
| 5251 loop_.RunAllPending(); | 5251 loop_.RunAllPending(); |
| 5252 | 5252 |
| 5253 ASSERT_TRUE(service_->PopulateExtensionErrorUI(extension_error_ui.get())); | 5253 ASSERT_TRUE(service_->PopulateExtensionErrorUI(extension_error_ui.get())); |
| 5254 ASSERT_EQ(1u, extension_error_ui->get_external_extension_ids()->size()); | 5254 ASSERT_EQ(1u, extension_error_ui->get_external_extension_ids()->size()); |
| 5255 } | 5255 } |
| OLD | NEW |