| 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 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 web_view()->focusedFrame()->executeCommand(WebString::fromUTF8(command), | 2221 web_view()->focusedFrame()->executeCommand(WebString::fromUTF8(command), |
| 2222 WebString::fromUTF8(value)); | 2222 WebString::fromUTF8(value)); |
| 2223 } | 2223 } |
| 2224 | 2224 |
| 2225 bool TestRunnerForSpecificView::IsCommandEnabled(const std::string& command) { | 2225 bool TestRunnerForSpecificView::IsCommandEnabled(const std::string& command) { |
| 2226 return web_view()->focusedFrame()->isCommandEnabled( | 2226 return web_view()->focusedFrame()->isCommandEnabled( |
| 2227 WebString::fromUTF8(command)); | 2227 WebString::fromUTF8(command)); |
| 2228 } | 2228 } |
| 2229 | 2229 |
| 2230 bool TestRunnerForSpecificView::CallShouldCloseOnWebView() { | 2230 bool TestRunnerForSpecificView::CallShouldCloseOnWebView() { |
| 2231 return web_view()->mainFrame()->dispatchBeforeUnloadEvent(); | 2231 bool proceed = false; |
| 2232 if (!web_view()->mainFrame()->toWebLocalFrame()->dispatchBeforeUnloadEvent( |
| 2233 &proceed)) { |
| 2234 return false; |
| 2235 } |
| 2236 |
| 2237 return proceed; |
| 2232 } | 2238 } |
| 2233 | 2239 |
| 2234 void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme( | 2240 void TestRunnerForSpecificView::SetDomainRelaxationForbiddenForURLScheme( |
| 2235 bool forbidden, | 2241 bool forbidden, |
| 2236 const std::string& scheme) { | 2242 const std::string& scheme) { |
| 2237 web_view()->setDomainRelaxationForbidden(forbidden, | 2243 web_view()->setDomainRelaxationForbidden(forbidden, |
| 2238 WebString::fromUTF8(scheme)); | 2244 WebString::fromUTF8(scheme)); |
| 2239 } | 2245 } |
| 2240 | 2246 |
| 2241 v8::Local<v8::Value> | 2247 v8::Local<v8::Value> |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3364 | 3370 |
| 3365 blink::WebView* TestRunnerForSpecificView::web_view() { | 3371 blink::WebView* TestRunnerForSpecificView::web_view() { |
| 3366 return web_test_proxy_base_->web_view(); | 3372 return web_test_proxy_base_->web_view(); |
| 3367 } | 3373 } |
| 3368 | 3374 |
| 3369 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 3375 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
| 3370 return web_test_proxy_base_->delegate(); | 3376 return web_test_proxy_base_->delegate(); |
| 3371 } | 3377 } |
| 3372 | 3378 |
| 3373 } // namespace test_runner | 3379 } // namespace test_runner |
| OLD | NEW |