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

Unified Diff: components/arc/arc_util_unittest.cc

Issue 2877883002: Consolidate two IsArcWindow functions to reduce code duplication (Closed)
Patch Set: address comments from Luis 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
« components/arc/arc_util.cc ('K') | « 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..45edda4f122aea4157a8f0a519fae84fbab7cc60 100644
--- a/components/arc/arc_util_unittest.cc
+++ b/components/arc/arc_util_unittest.cc
@@ -7,11 +7,14 @@
#include <memory>
#include <string>
+#include "ash/shared/app_types.h"
+#include "ash/wm_window.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/test/test_windows.h"
namespace arc {
namespace {
@@ -163,5 +166,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()));
+ ash::WmWindow* wm_window = ash::WmWindow::Get(window.get());
+ ASSERT_TRUE(wm_window);
+
+ wm_window->SetAppType(static_cast<int>(ash::AppType::CHROME_APP));
+ EXPECT_FALSE(IsArcAppWindow(window.get()));
+ wm_window->SetAppType(static_cast<int>(ash::AppType::ARC_APP));
+ EXPECT_TRUE(IsArcAppWindow(window.get()));
+
+ EXPECT_FALSE(IsArcAppWindow(nullptr));
+}
+
} // namespace
} // namespace arc
« components/arc/arc_util.cc ('K') | « components/arc/arc_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698