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

Unified Diff: components/arc/arc_util_unittest.cc

Issue 2877883002: Consolidate two IsArcWindow functions to reduce code duplication (Closed)
Patch Set: Address a comment from sadrul@ Created 3 years, 7 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
« no previous file with comments | « components/arc/arc_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_util_unittest.cc
diff --git a/components/arc/arc_util_unittest.cc b/components/arc/arc_util_unittest.cc
index a39c92bbc15000dd76a49158bd464bbb1174fa52..d083927672ee8e2d7d0da772da36dc4313909378 100644
--- a/components/arc/arc_util_unittest.cc
+++ b/components/arc/arc_util_unittest.cc
@@ -7,11 +7,15 @@
#include <memory>
#include <string>
+#include "ash/shared/app_types.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/test/test_windows.h"
+#include "ui/aura/window.h"
namespace arc {
namespace {
@@ -163,5 +167,20 @@ TEST_F(ArcUtilTest, IsArcOptInVerificationDisabled) {
EXPECT_TRUE(IsArcOptInVerificationDisabled());
}
+TEST_F(ArcUtilTest, IsArcAppWindow) {
+ std::unique_ptr<aura::Window> window(
+ aura::test::CreateTestWindowWithId(0, nullptr));
+ EXPECT_FALSE(IsArcAppWindow(window.get()));
+
+ window->SetProperty(aura::client::kAppType,
+ static_cast<int>(ash::AppType::CHROME_APP));
+ EXPECT_FALSE(IsArcAppWindow(window.get()));
+ window->SetProperty(aura::client::kAppType,
+ static_cast<int>(ash::AppType::ARC_APP));
+ EXPECT_TRUE(IsArcAppWindow(window.get()));
+
+ EXPECT_FALSE(IsArcAppWindow(nullptr));
+}
+
} // namespace
} // namespace arc
« no previous file with comments | « components/arc/arc_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698