[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / chromeos / network / onc / onc_test_utils.h
blobbc0d80e81890ecec061b863d2a04011f6648141b
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;
17 namespace chromeos {
18 namespace onc {
19 namespace test_utils {
21 // Read a JSON dictionary from |filename| and return it as a
22 // DictionaryValue. CHECKs if any error occurs.
23 scoped_ptr<base::DictionaryValue> ReadTestDictionary(
24 const std::string& filename);
26 // Checks that the pointer |actual| is not NULL but points to a dictionary that
27 // equals |expected| (using Value::Equals). The intended use case is:
28 // EXPECT_TRUE(test_utils::Equals(expected, actual));
29 ::testing::AssertionResult Equals(const base::DictionaryValue* expected,
30 const base::DictionaryValue* actual);
32 } // namespace test_utils
33 } // namespace onc
34 } // namespace chromeos
36 #endif // CHROMEOS_NETWORK_ONC_ONC_TEST_UTILS_H_