Index: ash/test/tray_cast_test_api.cc |
diff --git a/ash/test/tray_cast_test_api.cc b/ash/test/tray_cast_test_api.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dfa192cf4e057004c892def11d60c00623f987c8 |
--- /dev/null |
+++ b/ash/test/tray_cast_test_api.cc |
@@ -0,0 +1,48 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ash/test/tray_cast_test_api.h" |
+ |
+namespace ash { |
+ |
+TrayCastTestAPI::TrayCastTestAPI(TrayCast* tray_cast) : tray_cast_(tray_cast) { |
+} |
+ |
+TrayCastTestAPI::~TrayCastTestAPI() { |
+} |
+ |
+bool TrayCastTestAPI::IsTrayInitializedForTest() const { |
+ return tray_cast_->default_ != nullptr; |
+} |
+ |
+bool TrayCastTestAPI::IsTrayVisibleForTest() const { |
+ return tray_cast_->default_ != nullptr && tray_cast_->default_->IsDrawn(); |
+} |
+ |
+bool TrayCastTestAPI::IsTrayCastViewVisibleForTest() const { |
+ return tray_cast_->default_ != nullptr && |
+ tray_cast_->default_->ActiveChildView() == |
+ 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.
|
+} |
+ |
+bool TrayCastTestAPI::IsTraySelectViewVisibleForTest() const { |
+ return tray_cast_->default_ != nullptr && |
+ tray_cast_->default_->ActiveChildView() == |
+ tray_cast_->default_->select_view(); |
+} |
+ |
+void TrayCastTestAPI::StartCastForTest(const std::string& receiver_id) { |
+ if (tray_cast_->detailed_ != nullptr) |
+ tray_cast_->detailed_->SimulateViewClickedForTest(receiver_id); |
+} |
+ |
+void TrayCastTestAPI::StopCastForTest() { |
+ 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.
|
+} |
+ |
+void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) { |
+ tray_cast_->OnCastingSessionStartedOrStopped(is_casting); |
+} |
+ |
+} // namespace ash |