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

Unified Diff: sync/util/get_session_name_unittest.cc

Issue 32043003: Replace kChromeOSReleaseBoard with SysInfo::GetLsbReleaseBoard() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DEPS Created 7 years, 2 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 | « sync/util/get_session_name.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/get_session_name_unittest.cc
diff --git a/sync/util/get_session_name_unittest.cc b/sync/util/get_session_name_unittest.cc
index e97394569391151a9c1cdf155054fcccd7267842..724cd8b7f69c9a33a3c9d6e76a0bdc4b99dba62e 100644
--- a/sync/util/get_session_name_unittest.cc
+++ b/sync/util/get_session_name_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/sys_info.h"
#include "sync/util/get_session_name.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -42,15 +43,8 @@ TEST_F(GetSessionNameTest, GetSessionNameSynchronously) {
// Call GetSessionNameSynchronouslyForTesting on ChromeOS where the board type
// is "lumpy-signed-mp-v2keys" and make sure the return value is "Chromebook".
TEST_F(GetSessionNameTest, GetSessionNameSynchronouslyChromebook) {
- // This test cannot be run on a real CrOs device, since it will already have a
- // board type, and we cannot override it.
- // TODO(rsimha): Rewrite this test once http://crbug.com/126732 is fixed.
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(chromeos::switches::kChromeOSReleaseBoard))
- return;
-
- command_line->AppendSwitchASCII(chromeos::switches::kChromeOSReleaseBoard,
- "lumpy-signed-mp-v2keys");
+ const char* kLsbRelease = "CHROMEOS_RELEASE_BOARD=lumpy-signed-mp-v2keys\n";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
const std::string& session_name = GetSessionNameSynchronouslyForTesting();
EXPECT_EQ("Chromebook", session_name);
}
@@ -58,15 +52,8 @@ TEST_F(GetSessionNameTest, GetSessionNameSynchronouslyChromebook) {
// Call GetSessionNameSynchronouslyForTesting on ChromeOS where the board type
// is "stumpy-signed-mp-v2keys" and make sure the return value is "Chromebox".
TEST_F(GetSessionNameTest, GetSessionNameSynchronouslyChromebox) {
- // This test cannot be run on a real CrOs device, since it will already have a
- // board type, and we cannot override it.
- // TODO(rsimha): Rewrite this test once http://crbug.com/126732 is fixed.
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(chromeos::switches::kChromeOSReleaseBoard))
- return;
-
- command_line->AppendSwitchASCII(chromeos::switches::kChromeOSReleaseBoard,
- "stumpy-signed-mp-v2keys");
+ const char* kLsbRelease = "CHROMEOS_RELEASE_BOARD=stumpy-signed-mp-v2keys\n";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
const std::string& session_name = GetSessionNameSynchronouslyForTesting();
EXPECT_EQ("Chromebox", session_name);
}
« no previous file with comments | « sync/util/get_session_name.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698