Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: components/test_runner/test_runner.cc

Issue 1935593004: Extract WebWidgetTestClient out of WebTestProxyBase and WebViewTestClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test-runner-for-specific-view-separate
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/test_runner.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 1614
1615 void TestRunner::SetMainView(WebView* web_view) { 1615 void TestRunner::SetMainView(WebView* web_view) {
1616 main_view_ = web_view; 1616 main_view_ = web_view;
1617 } 1617 }
1618 1618
1619 void TestRunner::Reset() { 1619 void TestRunner::Reset() {
1620 top_loading_frame_ = nullptr; 1620 top_loading_frame_ = nullptr;
1621 layout_test_runtime_flags_.Reset(); 1621 layout_test_runtime_flags_.Reset();
1622 mock_screen_orientation_client_->ResetData(); 1622 mock_screen_orientation_client_->ResetData();
1623 drag_image_.reset(); 1623 drag_image_.reset();
1624 views_with_scheduled_animations_.clear(); 1624 widgets_with_scheduled_animations_.clear();
1625 1625
1626 WebSecurityPolicy::resetOriginAccessWhitelists(); 1626 WebSecurityPolicy::resetOriginAccessWhitelists();
1627 #if defined(__linux__) || defined(ANDROID) 1627 #if defined(__linux__) || defined(ANDROID)
1628 WebFontRendering::setSubpixelPositioning(false); 1628 WebFontRendering::setSubpixelPositioning(false);
1629 #endif 1629 #endif
1630 1630
1631 if (delegate_) { 1631 if (delegate_) {
1632 // Reset the default quota for each origin to 5MB 1632 // Reset the default quota for each origin to 5MB
1633 delegate_->SetDatabaseQuota(5 * 1024 * 1024); 1633 delegate_->SetDatabaseQuota(5 * 1024 * 1024);
1634 delegate_->SetDeviceColorProfile("reset"); 1634 delegate_->SetDeviceColorProfile("reset");
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 for (WebTestProxyBase* window : test_interfaces_->GetWindowList()) 2390 for (WebTestProxyBase* window : test_interfaces_->GetWindowList())
2391 window->web_view()->acceptLanguagesChanged(); 2391 window->web_view()->acceptLanguagesChanged();
2392 } 2392 }
2393 2393
2394 void TestRunner::SetPluginsEnabled(bool enabled) { 2394 void TestRunner::SetPluginsEnabled(bool enabled) {
2395 delegate_->Preferences()->plugins_enabled = enabled; 2395 delegate_->Preferences()->plugins_enabled = enabled;
2396 delegate_->ApplyPreferences(); 2396 delegate_->ApplyPreferences();
2397 } 2397 }
2398 2398
2399 bool TestRunner::GetAnimationScheduled() const { 2399 bool TestRunner::GetAnimationScheduled() const {
2400 bool is_animation_scheduled = !views_with_scheduled_animations_.empty(); 2400 bool is_animation_scheduled = !widgets_with_scheduled_animations_.empty();
2401 return is_animation_scheduled; 2401 return is_animation_scheduled;
2402 } 2402 }
2403 2403
2404 void TestRunner::OnAnimationScheduled(blink::WebView* view) { 2404 void TestRunner::OnAnimationScheduled(blink::WebWidget* widget) {
2405 views_with_scheduled_animations_.insert(view); 2405 widgets_with_scheduled_animations_.insert(widget);
2406 } 2406 }
2407 2407
2408 void TestRunner::OnAnimationBegun(blink::WebView* view) { 2408 void TestRunner::OnAnimationBegun(blink::WebWidget* widget) {
2409 views_with_scheduled_animations_.erase(view); 2409 widgets_with_scheduled_animations_.erase(widget);
2410 } 2410 }
2411 2411
2412 void TestRunner::DumpEditingCallbacks() { 2412 void TestRunner::DumpEditingCallbacks() {
2413 layout_test_runtime_flags_.set_dump_editting_callbacks(true); 2413 layout_test_runtime_flags_.set_dump_editting_callbacks(true);
2414 OnLayoutTestRuntimeFlagsChanged(); 2414 OnLayoutTestRuntimeFlagsChanged();
2415 } 2415 }
2416 2416
2417 void TestRunner::DumpAsMarkup() { 2417 void TestRunner::DumpAsMarkup() {
2418 layout_test_runtime_flags_.set_dump_as_markup(true); 2418 layout_test_runtime_flags_.set_dump_as_markup(true);
2419 layout_test_runtime_flags_.set_generate_pixel_results(false); 2419 layout_test_runtime_flags_.set_generate_pixel_results(false);
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 2778
2779 void TestRunner::CompleteNotifyDone() { 2779 void TestRunner::CompleteNotifyDone() {
2780 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && 2780 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() &&
2781 work_queue_.is_empty()) 2781 work_queue_.is_empty())
2782 delegate_->TestFinished(); 2782 delegate_->TestFinished();
2783 layout_test_runtime_flags_.set_wait_until_done(false); 2783 layout_test_runtime_flags_.set_wait_until_done(false);
2784 OnLayoutTestRuntimeFlagsChanged(); 2784 OnLayoutTestRuntimeFlagsChanged();
2785 } 2785 }
2786 2786
2787 } // namespace test_runner 2787 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/test_runner.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698