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

Side by Side Diff: components/ui/zoom/test/zoom_test_utils.cc

Issue 2019423005: Move //components/ui/zoom to top-level under //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « components/ui/zoom/test/zoom_test_utils.h ('k') | components/ui/zoom/zoom_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/ui/zoom/test/zoom_test_utils.h"
6
7 #include "content/public/test/test_utils.h"
8
9 namespace ui_zoom {
10
11 bool operator==(const ZoomController::ZoomChangedEventData& lhs,
12 const ZoomController::ZoomChangedEventData& rhs) {
13 return lhs.web_contents == rhs.web_contents &&
14 lhs.old_zoom_level == rhs.old_zoom_level &&
15 lhs.new_zoom_level == rhs.new_zoom_level &&
16 lhs.zoom_mode == rhs.zoom_mode &&
17 lhs.can_show_bubble == rhs.can_show_bubble;
18 }
19
20 ZoomChangedWatcher::ZoomChangedWatcher(
21 ZoomController* zoom_controller,
22 const ZoomController::ZoomChangedEventData& expected_event_data)
23 : zoom_controller_(zoom_controller),
24 expected_event_data_(expected_event_data),
25 message_loop_runner_(new content::MessageLoopRunner) {
26 zoom_controller_->AddObserver(this);
27 }
28
29 ZoomChangedWatcher::~ZoomChangedWatcher() {
30 zoom_controller_->RemoveObserver(this);
31 }
32
33 void ZoomChangedWatcher::Wait() {
34 message_loop_runner_->Run();
35 }
36
37 void ZoomChangedWatcher::OnZoomChanged(
38 const ZoomController::ZoomChangedEventData& event_data) {
39 if (event_data == expected_event_data_)
40 message_loop_runner_->Quit();
41 }
42
43 } // namespace ui_zoom
OLDNEW
« no previous file with comments | « components/ui/zoom/test/zoom_test_utils.h ('k') | components/ui/zoom/zoom_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698