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); |
} |