OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginHostFactory); | 139 DISALLOW_COPY_AND_ASSIGN(TestBrowserPluginHostFactory); |
140 }; | 140 }; |
141 | 141 |
142 // Test factory class for browser plugin that creates guests with short hang | 142 // Test factory class for browser plugin that creates guests with short hang |
143 // timeout. | 143 // timeout. |
144 class TestShortHangTimeoutGuestFactory : public TestBrowserPluginHostFactory { | 144 class TestShortHangTimeoutGuestFactory : public TestBrowserPluginHostFactory { |
145 public: | 145 public: |
146 virtual BrowserPluginGuest* CreateBrowserPluginGuest( | 146 virtual BrowserPluginGuest* CreateBrowserPluginGuest( |
147 int instance_id, WebContentsImpl* web_contents) OVERRIDE { | 147 int instance_id, WebContentsImpl* web_contents) OVERRIDE { |
148 BrowserPluginGuest* guest = | 148 TestBrowserPluginGuest* guest = |
149 new TestBrowserPluginGuest(instance_id, web_contents); | 149 new TestBrowserPluginGuest(instance_id, web_contents); |
150 guest->set_guest_hang_timeout_for_testing(TestTimeouts::tiny_timeout()); | 150 guest->set_guest_hang_timeout(TestTimeouts::tiny_timeout()); |
151 return guest; | 151 return guest; |
152 } | 152 } |
153 | 153 |
154 // Singleton getter. | 154 // Singleton getter. |
155 static TestShortHangTimeoutGuestFactory* GetInstance() { | 155 static TestShortHangTimeoutGuestFactory* GetInstance() { |
156 return Singleton<TestShortHangTimeoutGuestFactory>::get(); | 156 return Singleton<TestShortHangTimeoutGuestFactory>::get(); |
157 } | 157 } |
158 | 158 |
159 protected: | 159 protected: |
160 TestShortHangTimeoutGuestFactory() {} | 160 TestShortHangTimeoutGuestFactory() {} |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
803 | 803 |
804 // Attempt a navigation to chrome-guest://abc123, which is a valid URL. But it | 804 // Attempt a navigation to chrome-guest://abc123, which is a valid URL. But it |
805 // should be blocked because the scheme isn't web-safe or a pseudo-scheme. | 805 // should be blocked because the scheme isn't web-safe or a pseudo-scheme. |
806 ExecuteSyncJSFunction( | 806 ExecuteSyncJSFunction( |
807 test_embedder()->web_contents()->GetRenderViewHost(), | 807 test_embedder()->web_contents()->GetRenderViewHost(), |
808 base::StringPrintf("SetSrc('%s://abc123');", kGuestScheme)); | 808 base::StringPrintf("SetSrc('%s://abc123');", kGuestScheme)); |
809 EXPECT_TRUE(delegate->load_aborted()); | 809 EXPECT_TRUE(delegate->load_aborted()); |
810 EXPECT_TRUE(delegate->load_aborted_url().is_valid()); | 810 EXPECT_TRUE(delegate->load_aborted_url().is_valid()); |
811 } | 811 } |
812 | 812 |
813 | |
Charlie Reis
2013/11/13 19:04:28
nit: I don't think we want to add the extra line h
lazyboy
2013/11/13 19:21:11
Right, Done.
| |
813 } // namespace content | 814 } // namespace content |
OLD | NEW |