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

Side by Side Diff: content/shell/test_runner/test_runner_for_specific_view.cc

Issue 2907663004: FrameTree::Find only searches relative to local frames. (Closed)
Patch Set: . Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/shell/test_runner/test_runner_for_specific_view.h" 5 #include "content/shell/test_runner/test_runner_for_specific_view.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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 std::string TestRunnerForSpecificView::SelectionAsMarkup() { 672 std::string TestRunnerForSpecificView::SelectionAsMarkup() {
673 if (!web_view()->MainFrame()->ToWebLocalFrame()) { 673 if (!web_view()->MainFrame()->ToWebLocalFrame()) {
674 CHECK(false) << "This function cannot be called if the main frame is not a " 674 CHECK(false) << "This function cannot be called if the main frame is not a "
675 "local frame."; 675 "local frame.";
676 } 676 }
677 return web_view()->MainFrame()->ToWebLocalFrame()->SelectionAsMarkup().Utf8(); 677 return web_view()->MainFrame()->ToWebLocalFrame()->SelectionAsMarkup().Utf8();
678 } 678 }
679 679
680 void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name, 680 void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name,
681 bool enabled) { 681 bool enabled) {
682 if (!web_view()->MainFrame()->IsWebLocalFrame())
dcheng 2017/05/26 18:28:05 Is this something we'll need to fix at some point?
Łukasz Anforowicz 2017/05/26 20:04:05 Possibly. For now, let me just do what other simi
683 return;
684
682 WebFrame* target_frame = 685 WebFrame* target_frame =
683 web_view()->FindFrameByName(WebString::FromUTF8(name)); 686 web_view()->MainFrame()->ToWebLocalFrame()->FindFrameByName(
687 WebString::FromUTF8(name));
684 if (target_frame) 688 if (target_frame)
685 target_frame->EnableViewSourceMode(enabled); 689 target_frame->EnableViewSourceMode(enabled);
686 } 690 }
687 691
688 blink::WebView* TestRunnerForSpecificView::web_view() { 692 blink::WebView* TestRunnerForSpecificView::web_view() {
689 return web_view_test_proxy_base_->web_view(); 693 return web_view_test_proxy_base_->web_view();
690 } 694 }
691 695
692 WebTestDelegate* TestRunnerForSpecificView::delegate() { 696 WebTestDelegate* TestRunnerForSpecificView::delegate() {
693 return web_view_test_proxy_base_->delegate(); 697 return web_view_test_proxy_base_->delegate();
694 } 698 }
695 699
696 } // namespace test_runner 700 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698