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

Unified Diff: ash/test/tray_cast_test_api.h

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
Index: ash/test/tray_cast_test_api.h
diff --git a/ash/test/tray_cast_test_api.h b/ash/test/tray_cast_test_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..4decdb038b1998a418207a9fbd6ab6b4af096844
--- /dev/null
+++ b/ash/test/tray_cast_test_api.h
@@ -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.
+
+#ifndef ASH_TEST_TRAY_CAST_TEST_API_H_
+#define ASH_TEST_TRAY_CAST_TEST_API_H_
+
+#include <string>
+
+#include "ash/ash_export.h"
+#include "ash/system/cast/tray_cast.h"
+
+namespace ash {
+
+class ASH_EXPORT TrayCastTestAPI {
+ public:
+ explicit TrayCastTestAPI(TrayCast* tray_cast);
+ ~TrayCastTestAPI();
+
+ bool IsTrayInitialized() const;
+ bool IsTrayVisible() const;
+
+ // IsTrayCastViewVisible returns true if the active casting view is
+ // visible, ie, the TrayCast believes we are casting.
+ // IsTraySelectViewVisible returns true when the view for selecting a
+ // receiver is active, ie, the TrayCast believes we are not casting.
+ bool IsTrayCastViewVisible() const;
+ bool IsTraySelectViewVisible() const;
+
+ // Start a new cast to the given receiver.
+ void StartCast(const std::string& receiver_id);
+ void StopCast();
+
+ // Exposed callback to update the casting state. The test code needs to call
+ // this function manually, as there is no actual casting going on. In a real
+ // environment, this method is invoked by the casting system in Chrome.
+ void OnCastingSessionStartedOrStopped(bool is_casting);
+
+ private:
+ // Not owned.
+ TrayCast* tray_cast_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayCastTestAPI);
+};
+
+} // namespace ash
+
+#endif // ASH_TEST_TRAY_CAST_TEST_API_H_

Powered by Google App Engine
This is Rietveld 408576698