| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" | 10 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" |
| 11 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_consta
nts.h" | 11 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_consta
nts.h" |
| 12 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" | 12 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_
registry.h" |
| 13 #include "chrome/browser/extensions/extension_apitest.h" | 13 #include "chrome/browser/extensions/extension_apitest.h" |
| 14 #include "chrome/browser/extensions/extension_system_factory.h" | 14 #include "chrome/browser/extensions/extension_system_factory.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 18 #include "chrome/common/extensions/extension.h" | |
| 19 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 20 #include "extensions/common/extension.h" |
| 21 | 21 |
| 22 using extensions::RulesRegistry; | 22 using extensions::RulesRegistry; |
| 23 using extensions::RulesRegistryService; | 23 using extensions::RulesRegistryService; |
| 24 using extensions::WebRequestRulesRegistry; | 24 using extensions::WebRequestRulesRegistry; |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const char kArbitraryUrl[] = "http://www.example.com"; | 28 const char kArbitraryUrl[] = "http://www.example.com"; |
| 29 | 29 |
| 30 // The extension in "declarative/redirect_to_data" redirects every navigation to | 30 // The extension in "declarative/redirect_to_data" redirects every navigation to |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // PersistRules test first installs an extension, which registers some rules. | 76 // PersistRules test first installs an extension, which registers some rules. |
| 77 // Then after browser restart, it checks that the rules are still in effect. | 77 // Then after browser restart, it checks that the rules are still in effect. |
| 78 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PRE_PersistRules) { | 78 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PRE_PersistRules) { |
| 79 ASSERT_TRUE(RunExtensionTest("declarative/redirect_to_data")) << message_; | 79 ASSERT_TRUE(RunExtensionTest("declarative/redirect_to_data")) << message_; |
| 80 } | 80 } |
| 81 | 81 |
| 82 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PersistRules) { | 82 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PersistRules) { |
| 83 ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl)); | 83 ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl)); |
| 84 EXPECT_EQ(kTestTitle, GetTitle()); | 84 EXPECT_EQ(kTestTitle, GetTitle()); |
| 85 } | 85 } |
| OLD | NEW |