| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/test_runner.h" | 5 #include "components/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 web_view()->focusedFrame()->executeCommand(WebString::fromUTF8(command), | 2229 web_view()->focusedFrame()->executeCommand(WebString::fromUTF8(command), |
| 2230 WebString::fromUTF8(value)); | 2230 WebString::fromUTF8(value)); |
| 2231 } | 2231 } |
| 2232 | 2232 |
| 2233 bool TestRunnerForSpecificView::IsCommandEnabled(const std::string& command) { | 2233 bool TestRunnerForSpecificView::IsCommandEnabled(const std::string& command) { |
| 2234 return web_view()->focusedFrame()->isCommandEnabled( | 2234 return web_view()->focusedFrame()->isCommandEnabled( |
| 2235 WebString::fromUTF8(command)); | 2235 WebString::fromUTF8(command)); |
| 2236 } | 2236 } |
| 2237 | 2237 |
| 2238 bool TestRunnerForSpecificView::CallShouldCloseOnWebView() { | 2238 bool TestRunnerForSpecificView::CallShouldCloseOnWebView() { |
| 2239 return web_view()->mainFrame()->dispatchBeforeUnloadEvent(); | 2239 if (web_view()->mainFrame()->toWebLocalFrame()->dispatchBeforeUnloadEvent( |
| 2240 false) == blink::WebLocalFrame::BeforeUnloadReturnValue::Proceed) { |
| 2241 return true; |
| 2242 } |
| 2243 |
| 2244 return false; |
| 2240 } | 2245 } |
| 2241 | 2246 |
| 2242 void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme( | 2247 void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme( |
| 2243 bool forbidden, | 2248 bool forbidden, |
| 2244 const std::string& scheme) { | 2249 const std::string& scheme) { |
| 2245 web_view()->setDomainRelaxationForbidden(forbidden, | 2250 web_view()->setDomainRelaxationForbidden(forbidden, |
| 2246 WebString::fromUTF8(scheme)); | 2251 WebString::fromUTF8(scheme)); |
| 2247 } | 2252 } |
| 2248 | 2253 |
| 2249 v8::Local<v8::Value> | 2254 v8::Local<v8::Value> |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3377 | 3382 |
| 3378 blink::WebView* TestRunnerForSpecificView::web_view() { | 3383 blink::WebView* TestRunnerForSpecificView::web_view() { |
| 3379 return web_test_proxy_base_->web_view(); | 3384 return web_test_proxy_base_->web_view(); |
| 3380 } | 3385 } |
| 3381 | 3386 |
| 3382 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 3387 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
| 3383 return web_test_proxy_base_->delegate(); | 3388 return web_test_proxy_base_->delegate(); |
| 3384 } | 3389 } |
| 3385 | 3390 |
| 3386 } // namespace test_runner | 3391 } // namespace test_runner |
| OLD | NEW |