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

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

Issue 1218653006: Add support code to test the cast system tray item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Move testing API into ash/test Created 5 years, 5 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
« ash/test/tray_cast_test_api.h ('K') | « ash/test/tray_cast_test_api.h ('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
(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 "ash/test/tray_cast_test_api.h"
6
7 namespace ash {
8
9 TrayCastTestAPI::TrayCastTestAPI(TrayCast* tray_cast) : tray_cast_(tray_cast) {
10 }
11
12 TrayCastTestAPI::~TrayCastTestAPI() {
13 }
14
15 bool TrayCastTestAPI::IsTrayInitializedForTest() const {
16 return tray_cast_->default_ != nullptr;
17 }
18
19 bool TrayCastTestAPI::IsTrayVisibleForTest() const {
20 return tray_cast_->default_ != nullptr && tray_cast_->default_->IsDrawn();
21 }
22
23 bool TrayCastTestAPI::IsTrayCastViewVisibleForTest() const {
24 return tray_cast_->default_ != nullptr &&
25 tray_cast_->default_->ActiveChildView() ==
26 tray_cast_->default_->cast_view();
oshima 2015/07/17 22:59:28 easy way to test this is to define IDs for view in
jdufault 2015/07/18 00:55:42 Done.
27 }
28
29 bool TrayCastTestAPI::IsTraySelectViewVisibleForTest() const {
30 return tray_cast_->default_ != nullptr &&
31 tray_cast_->default_->ActiveChildView() ==
32 tray_cast_->default_->select_view();
33 }
34
35 void TrayCastTestAPI::StartCastForTest(const std::string& receiver_id) {
36 if (tray_cast_->detailed_ != nullptr)
37 tray_cast_->detailed_->SimulateViewClickedForTest(receiver_id);
38 }
39
40 void TrayCastTestAPI::StopCastForTest() {
41 tray_cast_->default_->cast_view()->StopCasting();
oshima 2015/07/17 22:59:28 and you can have these two methods on TrayCast.
jdufault 2015/07/18 00:55:42 Done.
42 }
43
44 void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) {
45 tray_cast_->OnCastingSessionStartedOrStopped(is_casting);
46 }
47
48 } // namespace ash
OLDNEW
« ash/test/tray_cast_test_api.h ('K') | « ash/test/tray_cast_test_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698