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

Unified Diff: sync/util/get_session_name_unittest.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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_mac.mm ('k') | sync/util/get_session_name_win.h » ('j') | 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
deleted file mode 100644
index 7001ad0e95eb212cae511641e1e6c711899a71a1..0000000000000000000000000000000000000000
--- a/sync/util/get_session_name_unittest.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <string>
-
-#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
-#include "base/run_loop.h"
-#include "base/sys_info.h"
-#include "build/build_config.h"
-#include "sync/util/get_session_name.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(OS_CHROMEOS)
-#include "base/command_line.h"
-#include "chromeos/chromeos_switches.h"
-#endif // OS_CHROMEOS
-
-namespace syncer {
-
-namespace {
-
-class GetSessionNameTest : public ::testing::Test {
- public:
- void SetSessionNameAndQuit(const std::string& session_name) {
- session_name_ = session_name;
- message_loop_.QuitWhenIdle();
- }
-
- protected:
- base::MessageLoop message_loop_;
- std::string session_name_;
-};
-
-// Call GetSessionNameSynchronouslyForTesting and make sure its return
-// value looks sane.
-TEST_F(GetSessionNameTest, GetSessionNameSynchronously) {
- const std::string& session_name = GetSessionNameSynchronouslyForTesting();
- EXPECT_FALSE(session_name.empty());
-}
-
-#if defined(OS_CHROMEOS)
-
-// Call GetSessionNameSynchronouslyForTesting on ChromeOS where the board type
-// is CHROMEBOOK and make sure the return value is "Chromebook".
-TEST_F(GetSessionNameTest, GetSessionNameSynchronouslyChromebook) {
- const char* kLsbRelease = "DEVICETYPE=CHROMEBOOK\n";
- base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
- const std::string& session_name = GetSessionNameSynchronouslyForTesting();
- EXPECT_EQ("Chromebook", session_name);
-}
-
-// Call GetSessionNameSynchronouslyForTesting on ChromeOS where the board type
-// is a CHROMEBOX and make sure the return value is "Chromebox".
-TEST_F(GetSessionNameTest, GetSessionNameSynchronouslyChromebox) {
- const char* kLsbRelease = "DEVICETYPE=CHROMEBOX\n";
- base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
- const std::string& session_name = GetSessionNameSynchronouslyForTesting();
- EXPECT_EQ("Chromebox", session_name);
-}
-
-#endif // OS_CHROMEOS
-
-// Calls GetSessionName and runs the message loop until it comes back
-// with a session name. Makes sure the returned session name is equal
-// to the return value of GetSessionNameSynchronouslyForTesting().
-TEST_F(GetSessionNameTest, GetSessionName) {
- GetSessionName(message_loop_.task_runner(),
- base::Bind(&GetSessionNameTest::SetSessionNameAndQuit,
- base::Unretained(this)));
- base::RunLoop().Run();
- EXPECT_EQ(session_name_, GetSessionNameSynchronouslyForTesting());
-}
-
-} // namespace
-
-} // namespace syncer
« no previous file with comments | « sync/util/get_session_name_mac.mm ('k') | sync/util/get_session_name_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698