[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / chromeos / network / onc / onc_test_utils.h
blob221318631cb8d991e6fbd5fccb2ad27bba1da91b
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.
5 #ifndef CHROMEOS_NETWORK_ONC_ONC_TEST_UTILS_H_
6 #define CHROMEOS_NETWORK_ONC_ONC_TEST_UTILS_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 namespace base {
14 class DictionaryValue;
15 class Value;
18 namespace chromeos {
19 namespace onc {
20 namespace test_utils {
22 // Read the file at |filename| as a string. CHECKs if any error occurs.
23 std::string ReadTestData(const std::string& filename);
25 // Read a JSON dictionary from |filename| and return it as a
26 // DictionaryValue. CHECKs if any error occurs.
27 scoped_ptr<base::DictionaryValue> ReadTestDictionary(
28 const std::string& filename);
30 // Checks that the pointer |actual| is not NULL but points to a value that
31 // equals |expected| (using Value::Equals). The intended use case is:
32 // EXPECT_TRUE(test_utils::Equals(expected, actual));
33 ::testing::AssertionResult Equals(const base::Value* expected,
34 const base::Value* actual);
36 } // namespace test_utils
37 } // namespace onc
38 } // namespace chromeos
40 #endif // CHROMEOS_NETWORK_ONC_ONC_TEST_UTILS_H_