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

Side by Side Diff: ash/test/test_metro_viewer_process_host.cc

Issue 584213002: Only do aggressive metro viewer termination in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ash/test/test_metro_viewer_process_host.h" 5 #include "ash/test/test_metro_viewer_process_host.h"
6 6
7 #include <windef.h> 7 #include <windef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/remote_window_tree_host_win.h" 10 #include "ui/aura/remote_window_tree_host_win.h"
11 #include "ui/gfx/win/dpi.h" 11 #include "ui/gfx/win/dpi.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace test { 14 namespace test {
15 15
16 TestMetroViewerProcessHost::TestMetroViewerProcessHost( 16 TestMetroViewerProcessHost::TestMetroViewerProcessHost(
17 base::SingleThreadTaskRunner* ipc_task_runner) 17 base::SingleThreadTaskRunner* ipc_task_runner)
18 : MetroViewerProcessHost(ipc_task_runner), 18 : MetroViewerProcessHost(ipc_task_runner),
19 closed_unexpectedly_(false) { 19 closed_unexpectedly_(false) {
20 } 20 }
21 21
22 TestMetroViewerProcessHost::~TestMetroViewerProcessHost() { 22 TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {
23 } 23 }
24 24
25 void TestMetroViewerProcessHost::TerminateViewer() {
26 DisposeViewer(GetViewerProcessId(), true);
27 }
28
25 void TestMetroViewerProcessHost::OnChannelError() { 29 void TestMetroViewerProcessHost::OnChannelError() {
26 closed_unexpectedly_ = true; 30 closed_unexpectedly_ = true;
27 aura::RemoteWindowTreeHostWin::Instance()->Disconnected(); 31 aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
28 } 32 }
29 33
30 void TestMetroViewerProcessHost::OnSetTargetSurface( 34 void TestMetroViewerProcessHost::OnSetTargetSurface(
31 gfx::NativeViewId target_surface, 35 gfx::NativeViewId target_surface,
32 float device_scale) { 36 float device_scale) {
33 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; 37 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
34 HWND hwnd = reinterpret_cast<HWND>(target_surface); 38 HWND hwnd = reinterpret_cast<HWND>(target_surface);
35 gfx::InitDeviceScaleFactor(device_scale); 39 gfx::InitDeviceScaleFactor(device_scale);
36 aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd); 40 aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd);
37 aura::RemoteWindowTreeHostWin::Instance()->Connected(this); 41 aura::RemoteWindowTreeHostWin::Instance()->Connected(this);
38 } 42 }
39 43
40 void TestMetroViewerProcessHost::OnOpenURL(const base::string16& url) { 44 void TestMetroViewerProcessHost::OnOpenURL(const base::string16& url) {
41 } 45 }
42 46
43 void TestMetroViewerProcessHost::OnHandleSearchRequest( 47 void TestMetroViewerProcessHost::OnHandleSearchRequest(
44 const base::string16& search_string) { 48 const base::string16& search_string) {
45 } 49 }
46 50
47 void TestMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, 51 void TestMetroViewerProcessHost::OnWindowSizeChanged(uint32 width,
48 uint32 height) { 52 uint32 height) {
49 } 53 }
50 54
51 } // namespace test 55 } // namespace test
52 } // namespace ash 56 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698