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

Unified Diff: base/nix/xdg_util_unittest.cc

Issue 2780863003: Fix base::nix::GetDesktopEnvironment for newer versions of Unity (Closed)
Patch Set: add new tests Created 3 years, 9 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 | « base/nix/xdg_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nix/xdg_util_unittest.cc
diff --git a/base/nix/xdg_util_unittest.cc b/base/nix/xdg_util_unittest.cc
index c8e53616ccdcfac88fb5960aacdc7c2cc212fff9..1219bba82c5ffc7cd74d5569146228c5bda9b378 100644
--- a/base/nix/xdg_util_unittest.cc
+++ b/base/nix/xdg_util_unittest.cc
@@ -35,6 +35,8 @@ const char* const kDesktopXFCE = "xfce";
const char* const kXdgDesktopGNOME = "GNOME";
const char* const kXdgDesktopKDE = "KDE";
const char* const kXdgDesktopUnity = "Unity";
+const char* const kXdgDesktopUnity7 = "Unity:Unity7";
+const char* const kXdgDesktopUnity8 = "Unity:Unity8";
const char* const kKDESessionKDE5 = "5";
const char kDesktopSession[] = "DESKTOP_SESSION";
@@ -138,5 +140,23 @@ TEST(XDGUtilTest, GetXdgDesktopUnity) {
EXPECT_EQ(DESKTOP_ENVIRONMENT_UNITY, GetDesktopEnvironment(&getter));
}
+TEST(XDGUtilTest, GetXdgDesktopUnity7) {
+ MockEnvironment getter;
+ EXPECT_CALL(getter, GetVar(_, _)).WillRepeatedly(Return(false));
+ EXPECT_CALL(getter, GetVar(Eq(kXdgDesktop), _))
+ .WillOnce(DoAll(SetArgumentPointee<1>(kXdgDesktopUnity7), Return(true)));
+
+ EXPECT_EQ(DESKTOP_ENVIRONMENT_UNITY, GetDesktopEnvironment(&getter));
+}
+
+TEST(XDGUtilTest, GetXdgDesktopUnity8) {
+ MockEnvironment getter;
+ EXPECT_CALL(getter, GetVar(_, _)).WillRepeatedly(Return(false));
+ EXPECT_CALL(getter, GetVar(Eq(kXdgDesktop), _))
+ .WillOnce(DoAll(SetArgumentPointee<1>(kXdgDesktopUnity8), Return(true)));
+
+ EXPECT_EQ(DESKTOP_ENVIRONMENT_UNITY, GetDesktopEnvironment(&getter));
+}
+
} // namespace nix
} // namespace base
« no previous file with comments | « base/nix/xdg_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698