| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/extensions/extension_info_map.h" | 9 #include "chrome/browser/extensions/extension_info_map.h" |
| 10 #include "chrome/browser/extensions/extension_protocols.h" | 10 #include "chrome/browser/extensions/extension_protocols.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 MessageLoopForIO message_loop_; | 81 MessageLoopForIO message_loop_; |
| 82 content::TestBrowserThread ui_thread_; | 82 content::TestBrowserThread ui_thread_; |
| 83 content::TestBrowserThread file_thread_; | 83 content::TestBrowserThread file_thread_; |
| 84 content::TestBrowserThread io_thread_; | 84 content::TestBrowserThread io_thread_; |
| 85 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 85 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 86 net::URLRequestJobFactoryImpl job_factory_; | 86 net::URLRequestJobFactoryImpl job_factory_; |
| 87 const net::URLRequestJobFactory* old_factory_; | 87 const net::URLRequestJobFactory* old_factory_; |
| 88 net::TestDelegate test_delegate_; | 88 TestDelegate test_delegate_; |
| 89 content::MockResourceContext resource_context_; | 89 content::MockResourceContext resource_context_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 // Tests that making a chrome-extension request in an incognito context is | 92 // Tests that making a chrome-extension request in an incognito context is |
| 93 // only allowed under the right circumstances (if the extension is allowed | 93 // only allowed under the right circumstances (if the extension is allowed |
| 94 // in incognito, and it's either a non-main-frame request or a split-mode | 94 // in incognito, and it's either a non-main-frame request or a split-mode |
| 95 // extension). | 95 // extension). |
| 96 TEST_F(ExtensionProtocolTest, IncognitoRequest) { | 96 TEST_F(ExtensionProtocolTest, IncognitoRequest) { |
| 97 struct TestCase { | 97 struct TestCase { |
| 98 // Inputs. | 98 // Inputs. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 cases[i].name; | 149 cases[i].name; |
| 150 } else { | 150 } else { |
| 151 EXPECT_EQ(net::ERR_ADDRESS_UNREACHABLE, request.status().error()) << | 151 EXPECT_EQ(net::ERR_ADDRESS_UNREACHABLE, request.status().error()) << |
| 152 cases[i].name; | 152 cases[i].name; |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace | 158 } // namespace |
| OLD | NEW |