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

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

Issue 2734713002: WebViewTestProxyBase: clear out main test delegate upon destruction. (Closed)
Patch Set: undo ps#2 Created 3 years, 9 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 | « content/shell/test_runner/mock_web_speech_recognizer.cc ('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 "content/shell/test_runner/web_view_test_proxy.h" 5 #include "content/shell/test_runner/web_view_test_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "content/shell/test_runner/accessibility_controller.h" 10 #include "content/shell/test_runner/accessibility_controller.h"
(...skipping 14 matching lines...) Expand all
25 delegate_(nullptr), 25 delegate_(nullptr),
26 web_view_(nullptr), 26 web_view_(nullptr),
27 accessibility_controller_(new AccessibilityController(this)), 27 accessibility_controller_(new AccessibilityController(this)),
28 text_input_controller_(new TextInputController(this)), 28 text_input_controller_(new TextInputController(this)),
29 view_test_runner_(new TestRunnerForSpecificView(this)) { 29 view_test_runner_(new TestRunnerForSpecificView(this)) {
30 WebWidgetTestProxyBase::set_web_view_test_proxy_base(this); 30 WebWidgetTestProxyBase::set_web_view_test_proxy_base(this);
31 } 31 }
32 32
33 WebViewTestProxyBase::~WebViewTestProxyBase() { 33 WebViewTestProxyBase::~WebViewTestProxyBase() {
34 test_interfaces_->WindowClosed(this); 34 test_interfaces_->WindowClosed(this);
35 if (test_interfaces_->GetDelegate() == delegate_)
36 test_interfaces_->SetDelegate(nullptr);
tasak 2017/03/07 03:06:01 I think, this breaks "--single-process". Received
35 } 37 }
36 38
37 void WebViewTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { 39 void WebViewTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) {
38 test_interfaces_ = interfaces->GetTestInterfaces(); 40 test_interfaces_ = interfaces->GetTestInterfaces();
39 test_interfaces_->WindowOpened(this); 41 test_interfaces_->WindowOpened(this);
40 } 42 }
41 43
42 void WebViewTestProxyBase::Reset() { 44 void WebViewTestProxyBase::Reset() {
43 accessibility_controller_->Reset(); 45 accessibility_controller_->Reset();
44 // text_input_controller_ doesn't have any state to reset. 46 // text_input_controller_ doesn't have any state to reset.
45 view_test_runner_->Reset(); 47 view_test_runner_->Reset();
46 WebWidgetTestProxyBase::Reset(); 48 WebWidgetTestProxyBase::Reset();
47 49
48 for (blink::WebFrame* frame = web_view_->mainFrame(); frame; 50 for (blink::WebFrame* frame = web_view_->mainFrame(); frame;
49 frame = frame->traverseNext()) { 51 frame = frame->traverseNext()) {
50 if (frame->isWebLocalFrame()) 52 if (frame->isWebLocalFrame())
51 delegate_->GetWebWidgetTestProxyBase(frame->toWebLocalFrame())->Reset(); 53 delegate_->GetWebWidgetTestProxyBase(frame->toWebLocalFrame())->Reset();
52 } 54 }
53 } 55 }
54 56
55 void WebViewTestProxyBase::BindTo(blink::WebLocalFrame* frame) { 57 void WebViewTestProxyBase::BindTo(blink::WebLocalFrame* frame) {
56 accessibility_controller_->Install(frame); 58 accessibility_controller_->Install(frame);
57 text_input_controller_->Install(frame); 59 text_input_controller_->Install(frame);
58 view_test_runner_->Install(frame); 60 view_test_runner_->Install(frame);
59 } 61 }
60 62
61 } // namespace test_runner 63 } // namespace test_runner
OLDNEW
« no previous file with comments | « content/shell/test_runner/mock_web_speech_recognizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698