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

Side by Side Diff: chrome/browser/sync/util/get_session_name_unittest.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "base/bind.h"
8 #include "base/message_loop.h"
9 #include "chrome/browser/sync/util/get_session_name.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace browser_sync {
13
14 namespace {
15
16 class GetSessionNameTest : public ::testing::Test {
17 public:
18 void SetSessionNameAndQuit(const std::string& session_name) {
19 session_name_ = session_name;
20 message_loop_.Quit();
21 }
22
23 protected:
24 MessageLoop message_loop_;
25 std::string session_name_;
26 };
27
28 // Call GetSessionNameSynchronouslyForTesting and make sure its return
29 // value looks sane.
30 TEST_F(GetSessionNameTest, GetSessionNameSynchronously) {
31 const std::string& session_name = GetSessionNameSynchronouslyForTesting();
32 EXPECT_FALSE(session_name.empty());
33 }
34
35 // Calls GetSessionName and runs the message loop until it comes back
36 // with a session name. Makes sure the returned session name is equal
37 // to the return value of GetSessionNameSynchronouslyForTesting().
38 TEST_F(GetSessionNameTest, GetSessionName) {
39 GetSessionName(message_loop_.message_loop_proxy(),
40 base::Bind(&GetSessionNameTest::SetSessionNameAndQuit,
41 base::Unretained(this)));
42 message_loop_.Run();
43 EXPECT_EQ(session_name_, GetSessionNameSynchronouslyForTesting());
44 }
45
46 } // namespace
47
48 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/util/get_session_name_mac.mm ('k') | chrome/browser/sync/util/get_session_name_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698