OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/chromeos/login/screens/screen_context.h" | 9 #include "components/login/screens/screen_context.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace login { |
13 | 13 |
14 class ScreenContextTest : public testing::Test { | 14 class ScreenContextTest : public testing::Test { |
15 public: | 15 public: |
16 ScreenContextTest() {} | 16 ScreenContextTest() {} |
17 virtual ~ScreenContextTest() {} | 17 virtual ~ScreenContextTest() {} |
18 | 18 |
19 virtual void SetUp() { | 19 virtual void SetUp() { context_.reset(new ScreenContext()); } |
20 context_.reset(new ScreenContext()); | |
21 } | |
22 | 20 |
23 virtual void TearDown() { | 21 virtual void TearDown() {} |
24 } | |
25 | 22 |
26 protected: | 23 protected: |
27 ScreenContext& context() { return *context_.get(); } | 24 ScreenContext& context() { return *context_.get(); } |
28 | 25 |
29 private: | 26 private: |
30 scoped_ptr<ScreenContext> context_; | 27 scoped_ptr<ScreenContext> context_; |
31 }; | 28 }; |
32 | 29 |
33 TEST_F(ScreenContextTest, Simple) { | 30 TEST_F(ScreenContextTest, Simple) { |
34 ASSERT_FALSE(context().HasChanges()); | 31 ASSERT_FALSE(context().HasChanges()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 ASSERT_EQ("key0", keys[0]); | 144 ASSERT_EQ("key0", keys[0]); |
148 ASSERT_EQ("key1", keys[1]); | 145 ASSERT_EQ("key1", keys[1]); |
149 ASSERT_EQ("key2", keys[2]); | 146 ASSERT_EQ("key2", keys[2]); |
150 | 147 |
151 ASSERT_FALSE(context().HasChanges()); | 148 ASSERT_FALSE(context().HasChanges()); |
152 ASSERT_EQ("value0", context().GetString("key0")); | 149 ASSERT_EQ("value0", context().GetString("key0")); |
153 ASSERT_EQ(1, context().GetInteger("key1")); | 150 ASSERT_EQ(1, context().GetInteger("key1")); |
154 ASSERT_TRUE(context().GetBoolean("key2")); | 151 ASSERT_TRUE(context().GetBoolean("key2")); |
155 } | 152 } |
156 | 153 |
157 } // namespace chromeos | 154 } // namespace login |
OLD | NEW |