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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5af342f11b82a66c46611e3a6d01d7adae2294d5
--- /dev/null
+++ b/ash/test/tray_cast_test_api.cc
@@ -0,0 +1,50 @@
+// 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 {
+ views::View* tray_view =
achuithb 2015/07/20 22:28:26 nit: const should work here?
jdufault 2015/07/20 22:39:57 Done.
+ tray_cast_->system_tray()->GetViewByID(TrayCast::TRAY_VIEW);
+ return tray_view != nullptr && tray_view->IsDrawn();
+}
+
+bool TrayCastTestAPI::IsTrayCastViewVisible() const {
+ return tray_cast_->system_tray()->GetViewByID(TrayCast::CAST_VIEW)->IsDrawn();
+}
+
+bool TrayCastTestAPI::IsTraySelectViewVisible() const {
+ return tray_cast_->system_tray()
+ ->GetViewByID(TrayCast::SELECT_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
« 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