Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |