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

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

Issue 2586943004: DevTools: disable compilation cache for inspector tests to reduce flakiness. (Closed)
Patch Set: Created 4 years 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') | no next file » | 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 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 void TestRunner::SetDelegate(WebTestDelegate* delegate) { 1619 void TestRunner::SetDelegate(WebTestDelegate* delegate) {
1620 delegate_ = delegate; 1620 delegate_ = delegate;
1621 mock_content_settings_client_->SetDelegate(delegate); 1621 mock_content_settings_client_->SetDelegate(delegate);
1622 spellcheck_->SetDelegate(delegate); 1622 spellcheck_->SetDelegate(delegate);
1623 if (speech_recognizer_) 1623 if (speech_recognizer_)
1624 speech_recognizer_->SetDelegate(delegate); 1624 speech_recognizer_->SetDelegate(delegate);
1625 } 1625 }
1626 1626
1627 void TestRunner::SetMainView(WebView* web_view) { 1627 void TestRunner::SetMainView(WebView* web_view) {
1628 main_view_ = web_view; 1628 main_view_ = web_view;
1629 if (disable_v8_cache_)
1630 SetV8CacheDisabled(true);
1629 } 1631 }
1630 1632
1631 void TestRunner::Reset() { 1633 void TestRunner::Reset() {
1632 is_web_platform_tests_mode_ = false; 1634 is_web_platform_tests_mode_ = false;
1633 will_navigate_ = false; 1635 will_navigate_ = false;
1634 top_loading_frame_ = nullptr; 1636 top_loading_frame_ = nullptr;
1635 layout_test_runtime_flags_.Reset(); 1637 layout_test_runtime_flags_.Reset();
1636 mock_screen_orientation_client_->ResetData(); 1638 mock_screen_orientation_client_->ResetData();
1637 drag_image_.reset(); 1639 drag_image_.reset();
1638 1640
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 } 1960 }
1959 1961
1960 midi::mojom::Result TestRunner::midiAccessorResult() { 1962 midi::mojom::Result TestRunner::midiAccessorResult() {
1961 return midi_accessor_result_; 1963 return midi_accessor_result_;
1962 } 1964 }
1963 1965
1964 void TestRunner::ClearDevToolsLocalStorage() { 1966 void TestRunner::ClearDevToolsLocalStorage() {
1965 delegate_->ClearDevToolsLocalStorage(); 1967 delegate_->ClearDevToolsLocalStorage();
1966 } 1968 }
1967 1969
1970 void TestRunner::SetV8CacheDisabled(bool disabled) {
1971 if (!main_view_) {
1972 disable_v8_cache_ = disabled;
1973 return;
1974 }
1975 main_view_->settings()->setV8CacheOptions(disabled ?
1976 blink::WebSettings::V8CacheOptionsNone :
1977 blink::WebSettings::V8CacheOptionsDefault);
1978 }
1979
1968 void TestRunner::ShowDevTools(const std::string& settings, 1980 void TestRunner::ShowDevTools(const std::string& settings,
1969 const std::string& frontend_url) { 1981 const std::string& frontend_url) {
1970 delegate_->ShowDevTools(settings, frontend_url); 1982 delegate_->ShowDevTools(settings, frontend_url);
1971 } 1983 }
1972 1984
1973 class WorkItemBackForward : public TestRunner::WorkItem { 1985 class WorkItemBackForward : public TestRunner::WorkItem {
1974 public: 1986 public:
1975 WorkItemBackForward(int distance) : distance_(distance) {} 1987 WorkItemBackForward(int distance) : distance_(distance) {}
1976 1988
1977 bool Run(WebTestDelegate* delegate, WebView*) override { 1989 bool Run(WebTestDelegate* delegate, WebView*) override {
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 2792
2781 void TestRunner::NotifyDone() { 2793 void TestRunner::NotifyDone() {
2782 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && 2794 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() &&
2783 !will_navigate_ && work_queue_.is_empty()) 2795 !will_navigate_ && work_queue_.is_empty())
2784 delegate_->TestFinished(); 2796 delegate_->TestFinished();
2785 layout_test_runtime_flags_.set_wait_until_done(false); 2797 layout_test_runtime_flags_.set_wait_until_done(false);
2786 OnLayoutTestRuntimeFlagsChanged(); 2798 OnLayoutTestRuntimeFlagsChanged();
2787 } 2799 }
2788 2800
2789 } // namespace test_runner 2801 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698