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

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

Issue 1893783002: Split TestRunner::setTopLoadingFrame into separate "set" and "clear" methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replicate-across-all-renderers
Patch Set: Rebasing... Created 4 years, 8 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
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 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 } 1929 }
1930 1930
1931 bool TestRunner::shouldWaitUntilExternalURLLoad() const { 1931 bool TestRunner::shouldWaitUntilExternalURLLoad() const {
1932 return layout_test_runtime_flags_.wait_until_external_url_load(); 1932 return layout_test_runtime_flags_.wait_until_external_url_load();
1933 } 1933 }
1934 1934
1935 const std::set<std::string>* TestRunner::httpHeadersToClear() const { 1935 const std::set<std::string>* TestRunner::httpHeadersToClear() const {
1936 return &http_headers_to_clear_; 1936 return &http_headers_to_clear_;
1937 } 1937 }
1938 1938
1939 void TestRunner::setTopLoadingFrame(WebFrame* frame, bool clear) { 1939 bool TestRunner::isFramePartOfMainTestWindow(blink::WebFrame* frame) const {
1940 if (frame->top()->view() != main_view_) 1940 return test_is_running_ && frame->top()->view() == main_view_;
1941 }
1942
1943 void TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
1944 if (!isFramePartOfMainTestWindow(frame))
1941 return; 1945 return;
1942 if (!test_is_running_) 1946
1947 if (top_loading_frame_)
1943 return; 1948 return;
1944 if (clear) { 1949
1945 top_loading_frame_ = nullptr; 1950 top_loading_frame_ = frame;
1946 LocationChangeDone(); 1951 }
1947 } else if (!top_loading_frame_) { 1952
1948 top_loading_frame_ = frame; 1953 void TestRunner::tryToClearTopLoadingFrame(WebFrame* frame) {
1949 } 1954 if (!isFramePartOfMainTestWindow(frame))
1955 return;
1956
1957 if (frame != top_loading_frame_)
1958 return;
1959
1960 top_loading_frame_ = nullptr;
1961 LocationChangeDone();
1950 } 1962 }
1951 1963
1952 WebFrame* TestRunner::topLoadingFrame() const { 1964 WebFrame* TestRunner::topLoadingFrame() const {
1953 return top_loading_frame_; 1965 return top_loading_frame_;
1954 } 1966 }
1955 1967
1956 void TestRunner::policyDelegateDone() { 1968 void TestRunner::policyDelegateDone() {
1957 DCHECK(layout_test_runtime_flags_.wait_until_done()); 1969 DCHECK(layout_test_runtime_flags_.wait_until_done());
1958 delegate_->TestFinished(); 1970 delegate_->TestFinished();
1959 layout_test_runtime_flags_.set_wait_until_done(false); 1971 layout_test_runtime_flags_.set_wait_until_done(false);
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
3342 3354
3343 blink::WebView* TestRunnerForSpecificView::web_view() { 3355 blink::WebView* TestRunnerForSpecificView::web_view() {
3344 return web_test_proxy_base_->web_view(); 3356 return web_test_proxy_base_->web_view();
3345 } 3357 }
3346 3358
3347 WebTestDelegate* TestRunnerForSpecificView::delegate() { 3359 WebTestDelegate* TestRunnerForSpecificView::delegate() {
3348 return web_test_proxy_base_->delegate(); 3360 return web_test_proxy_base_->delegate();
3349 } 3361 }
3350 3362
3351 } // namespace test_runner 3363 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698