OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/popup.html")); | 996 "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/popup.html")); |
997 resource_type_ = ResourceType::STYLESHEET; | 997 resource_type_ = ResourceType::STYLESHEET; |
998 resource_handler_.reset(new DummyResourceHandler()); | 998 resource_handler_.reset(new DummyResourceHandler()); |
999 request_info_.reset(CreateNewResourceRequestInfo()); | 999 request_info_.reset(CreateNewResourceRequestInfo()); |
1000 } | 1000 } |
1001 | 1001 |
1002 ResourceDispatcherHostRequestInfo* CreateNewResourceRequestInfo() { | 1002 ResourceDispatcherHostRequestInfo* CreateNewResourceRequestInfo() { |
1003 return new ResourceDispatcherHostRequestInfo( | 1003 return new ResourceDispatcherHostRequestInfo( |
1004 resource_handler_.get(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0, | 1004 resource_handler_.get(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0, |
1005 "not important", "not important", | 1005 "not important", "not important", |
1006 ResourceType::STYLESHEET, 0U, false, false, -1, -1); | 1006 ResourceType::STYLESHEET, 0U, false, false, false, -1, -1); |
1007 } | 1007 } |
1008 | 1008 |
1009 scoped_ptr<GURL> url_; | 1009 scoped_ptr<GURL> url_; |
1010 ResourceType::Type resource_type_; | 1010 ResourceType::Type resource_type_; |
1011 scoped_ptr<DummyResourceHandler> resource_handler_; | 1011 scoped_ptr<DummyResourceHandler> resource_handler_; |
1012 scoped_ptr<ResourceDispatcherHostRequestInfo> request_info_; | 1012 scoped_ptr<ResourceDispatcherHostRequestInfo> request_info_; |
1013 }; | 1013 }; |
1014 | 1014 |
1015 TEST_F(ApplyExtensionLocalizationFilterTest, WrongScheme) { | 1015 TEST_F(ApplyExtensionLocalizationFilterTest, WrongScheme) { |
1016 url_.reset(new GURL("html://behllobkkfkfnphdnhnkndlbkcpglgmj/popup.html")); | 1016 url_.reset(new GURL("html://behllobkkfkfnphdnhnkndlbkcpglgmj/popup.html")); |
(...skipping 10 matching lines...) Expand all Loading... |
1027 EXPECT_TRUE(request_info_->replace_extension_localization_templates()); | 1027 EXPECT_TRUE(request_info_->replace_extension_localization_templates()); |
1028 } | 1028 } |
1029 | 1029 |
1030 TEST_F(ApplyExtensionLocalizationFilterTest, GoodSchemeWrongResourceType) { | 1030 TEST_F(ApplyExtensionLocalizationFilterTest, GoodSchemeWrongResourceType) { |
1031 resource_type_ = ResourceType::MAIN_FRAME; | 1031 resource_type_ = ResourceType::MAIN_FRAME; |
1032 ResourceDispatcherHost::ApplyExtensionLocalizationFilter(*url_, | 1032 ResourceDispatcherHost::ApplyExtensionLocalizationFilter(*url_, |
1033 resource_type_, request_info_.get()); | 1033 resource_type_, request_info_.get()); |
1034 | 1034 |
1035 EXPECT_FALSE(request_info_->replace_extension_localization_templates()); | 1035 EXPECT_FALSE(request_info_->replace_extension_localization_templates()); |
1036 } | 1036 } |
OLD | NEW |