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_
10 #include "base/memory/scoped_ptr.h"
11 #include "testing/gtest/include/gtest/gtest.h"
14 class DictionaryValue
;
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
38 } // namespace chromeos
40 #endif // CHROMEOS_NETWORK_ONC_ONC_TEST_UTILS_H_