| 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/api/declarative/rules_registry.h" | 5 #include "chrome/browser/extensions/api/declarative/rules_registry.h" |
| 6 | 6 |
| 7 // Here we test the TestRulesRegistry which is the simplest possible | 7 // Here we test the TestRulesRegistry which is the simplest possible |
| 8 // implementation of RulesRegistryWithCache as a proxy for | 8 // implementation of RulesRegistryWithCache as a proxy for |
| 9 // RulesRegistryWithCache. | 9 // RulesRegistryWithCache. |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "chrome/browser/extensions/api/declarative/rules_cache_delegate.h" | 13 #include "chrome/browser/extensions/api/declarative/rules_cache_delegate.h" |
| 14 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h" | 14 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h" |
| 15 #include "chrome/browser/extensions/extension_prefs.h" | |
| 16 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
| 17 #include "chrome/browser/extensions/test_extension_environment.h" | 16 #include "chrome/browser/extensions/test_extension_environment.h" |
| 18 #include "chrome/browser/extensions/test_extension_system.h" | 17 #include "chrome/browser/extensions/test_extension_system.h" |
| 19 #include "chrome/browser/value_store/testing_value_store.h" | 18 #include "chrome/browser/value_store/testing_value_store.h" |
| 20 #include "chrome/common/extensions/extension_test_util.h" | 19 #include "chrome/common/extensions/extension_test_util.h" |
| 21 #include "chrome/common/extensions/features/feature_channel.h" | 20 #include "chrome/common/extensions/features/feature_channel.h" |
| 22 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
| 22 #include "content/public/test/test_browser_thread_bundle.h" |
| 23 #include "extensions/browser/extension_prefs.h" |
| 23 #include "extensions/common/extension.h" | 24 #include "extensions/common/extension.h" |
| 24 #include "extensions/common/manifest_constants.h" | 25 #include "extensions/common/manifest_constants.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 27 |
| 27 using extension_test_util::LoadManifestUnchecked; | 28 using extension_test_util::LoadManifestUnchecked; |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 const char kRuleId[] = "rule"; | 31 const char kRuleId[] = "rule"; |
| 31 const char kRule2Id[] = "rule2"; | 32 const char kRule2Id[] = "rule2"; |
| 32 } | 33 } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 389 |
| 389 int write_count = store->write_count(); | 390 int write_count = store->write_count(); |
| 390 EXPECT_EQ("", AddRule(extension1_->id(), kRuleId)); | 391 EXPECT_EQ("", AddRule(extension1_->id(), kRuleId)); |
| 391 EXPECT_EQ("", AddRule(extension2_->id(), kRule2Id)); | 392 EXPECT_EQ("", AddRule(extension2_->id(), kRule2Id)); |
| 392 env_.GetExtensionSystem()->SetReady(); | 393 env_.GetExtensionSystem()->SetReady(); |
| 393 base::RunLoop().RunUntilIdle(); | 394 base::RunLoop().RunUntilIdle(); |
| 394 EXPECT_EQ(write_count + 2, store->write_count()); | 395 EXPECT_EQ(write_count + 2, store->write_count()); |
| 395 } | 396 } |
| 396 | 397 |
| 397 } // namespace extensions | 398 } // namespace extensions |
| OLD | NEW |