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

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: 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/system/cast/tray_cast.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 #include "ash/system/tray/system_tray.h"
8 #include "ui/views/view.h"
9
10 namespace ash {
11
12 TrayCastTestAPI::TrayCastTestAPI(TrayCast* tray_cast) : tray_cast_(tray_cast) {
13 }
14
15 TrayCastTestAPI::~TrayCastTestAPI() {
16 }
17
18 bool TrayCastTestAPI::IsTrayInitialized() const {
19 return tray_cast_->default_ != nullptr;
20 }
21
22 bool TrayCastTestAPI::IsTrayVisible() const {
23 return IsViewDrawn(TrayCast::TRAY_VIEW);
24 }
25
26 bool TrayCastTestAPI::IsTrayCastViewVisible() const {
27 return IsViewDrawn(TrayCast::CAST_VIEW);
28 }
29
30 bool TrayCastTestAPI::IsTraySelectViewVisible() const {
31 return IsViewDrawn(TrayCast::SELECT_VIEW);
32 }
33
34 void TrayCastTestAPI::StartCast(const std::string& receiver_id) {
35 return tray_cast_->StartCastForTest(receiver_id);
36 }
37
38 void TrayCastTestAPI::StopCast() {
39 return tray_cast_->StopCastForTest();
40 }
41
42 void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) {
43 tray_cast_->OnCastingSessionStartedOrStopped(is_casting);
44 }
45
46 bool TrayCastTestAPI::IsViewDrawn(TrayCast::ChildViewId id) const {
47 const views::View* view = tray_cast_->default_view()->GetViewByID(id);
48 return view != nullptr && view->IsDrawn();
49 }
50
51 } // namespace ash
OLDNEW
« ash/system/cast/tray_cast.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