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

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, 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/web_frame_test_client.cc » ('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 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 return; 1941 }
1942 if (!test_is_running_) 1942
1943 return; 1943 bool TestRunner::tryToSetTopLoadingFrame(WebFrame* frame) {
1944 if (clear) { 1944 if (!IsFramePartOfMainTestWindow(frame))
1945 top_loading_frame_ = nullptr; 1945 return false;
1946 LocationChangeDone(); 1946
1947 } else if (!top_loading_frame_) { 1947 if (top_loading_frame_)
1948 top_loading_frame_ = frame; 1948 return false;
1949 } 1949
1950 top_loading_frame_ = frame;
1951 return true;
1952 }
1953
1954 bool TestRunner::tryToClearTopLoadingFrame(WebFrame* frame) {
1955 if (!IsFramePartOfMainTestWindow(frame))
1956 return false;
1957
1958 if (frame != top_loading_frame_)
1959 return false;
1960
1961 top_loading_frame_ = nullptr;
1962 LocationChangeDone();
1963 return true;
1950 } 1964 }
1951 1965
1952 WebFrame* TestRunner::topLoadingFrame() const { 1966 WebFrame* TestRunner::topLoadingFrame() const {
1953 return top_loading_frame_; 1967 return top_loading_frame_;
1954 } 1968 }
1955 1969
1956 void TestRunner::policyDelegateDone() { 1970 void TestRunner::policyDelegateDone() {
1957 DCHECK(layout_test_runtime_flags_.wait_until_done()); 1971 DCHECK(layout_test_runtime_flags_.wait_until_done());
1958 delegate_->TestFinished(); 1972 delegate_->TestFinished();
1959 layout_test_runtime_flags_.set_wait_until_done(false); 1973 layout_test_runtime_flags_.set_wait_until_done(false);
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
3342 3356
3343 blink::WebView* TestRunnerForSpecificView::web_view() { 3357 blink::WebView* TestRunnerForSpecificView::web_view() {
3344 return web_test_proxy_base_->web_view(); 3358 return web_test_proxy_base_->web_view();
3345 } 3359 }
3346 3360
3347 WebTestDelegate* TestRunnerForSpecificView::delegate() { 3361 WebTestDelegate* TestRunnerForSpecificView::delegate() {
3348 return web_test_proxy_base_->delegate(); 3362 return web_test_proxy_base_->delegate();
3349 } 3363 }
3350 3364
3351 } // namespace test_runner 3365 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_frame_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698