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..2785d9a12d92703b57135174965bff4341aa64b6 |
--- /dev/null |
+++ b/ash/test/tray_cast_test_api.cc |
@@ -0,0 +1,52 @@ |
+// 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" |
+ |
+#include "ash/system/tray/system_tray.h" |
+#include "ui/views/view.h" |
+ |
+namespace ash { |
+ |
+TrayCastTestAPI::TrayCastTestAPI(TrayCast* tray_cast) : tray_cast_(tray_cast) { |
+} |
+ |
+TrayCastTestAPI::~TrayCastTestAPI() { |
+} |
+ |
+bool TrayCastTestAPI::IsTrayInitialized() const { |
+ return tray_cast_->default_ != nullptr; |
+} |
+ |
+bool TrayCastTestAPI::IsTrayVisible() const { |
achuithb
2015/07/21 19:52:29
Create a helper like:
bool IsTrayViewVisible(Chil
jdufault
2015/07/21 20:21:31
Done.
|
+ const views::View* view = |
+ tray_cast_->default_view()->GetViewByID(TrayCast::TRAY_VIEW); |
+ return view != nullptr && view->IsDrawn(); |
+} |
+ |
+bool TrayCastTestAPI::IsTrayCastViewVisible() const { |
+ views::View* view = |
achuithb
2015/07/21 19:52:29
const
jdufault
2015/07/21 20:21:31
Done.
|
+ tray_cast_->default_view()->GetViewByID(TrayCast::CAST_VIEW); |
+ return view != nullptr && view->IsDrawn(); |
+} |
+ |
+bool TrayCastTestAPI::IsTraySelectViewVisible() const { |
+ views::View* view = |
achuithb
2015/07/21 19:52:29
const
jdufault
2015/07/21 20:21:31
Done.
|
+ tray_cast_->default_view()->GetViewByID(TrayCast::SELECT_VIEW); |
+ return view != nullptr && view->IsDrawn(); |
+} |
+ |
+void TrayCastTestAPI::StartCast(const std::string& receiver_id) { |
+ return tray_cast_->StartCastForTest(receiver_id); |
+} |
+ |
+void TrayCastTestAPI::StopCast() { |
+ return tray_cast_->StopCastForTest(); |
+} |
+ |
+void TrayCastTestAPI::OnCastingSessionStartedOrStopped(bool is_casting) { |
+ tray_cast_->OnCastingSessionStartedOrStopped(is_casting); |
+} |
+ |
+} // namespace ash |