OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/display/json_converter.h" | 5 #include "ash/display/json_converter.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 std::string error_msg; | 78 std::string error_msg; |
79 std::unique_ptr<base::Value> read_value(base::JSONReader::ReadAndReturnError( | 79 std::unique_ptr<base::Value> read_value(base::JSONReader::ReadAndReturnError( |
80 data, 0, &error_code, &error_msg, &error_line, &error_column)); | 80 data, 0, &error_code, &error_msg, &error_line, &error_column)); |
81 ASSERT_EQ(0, error_code) << error_msg << " at " << error_line << ":" | 81 ASSERT_EQ(0, error_code) << error_msg << " at " << error_line << ":" |
82 << error_column; | 82 << error_column; |
83 | 83 |
84 display::DisplayLayout read_layout; | 84 display::DisplayLayout read_layout; |
85 EXPECT_TRUE(JsonToDisplayLayout(*read_value, &read_layout)); | 85 EXPECT_TRUE(JsonToDisplayLayout(*read_value, &read_layout)); |
86 EXPECT_EQ(true, read_layout.mirrored); | 86 EXPECT_EQ(true, read_layout.mirrored); |
87 EXPECT_EQ(1, read_layout.primary_id); | 87 EXPECT_EQ(1, read_layout.primary_id); |
88 EXPECT_EQ(false, read_layout.default_unified); | 88 EXPECT_FALSE(read_layout.default_unified); |
89 ASSERT_EQ(1u, read_layout.placement_list.size()); | 89 ASSERT_EQ(1u, read_layout.placement_list.size()); |
90 EXPECT_EQ(display::DisplayPlacement::BOTTOM, | 90 EXPECT_EQ(display::DisplayPlacement::BOTTOM, |
91 read_layout.placement_list[0].position); | 91 read_layout.placement_list[0].position); |
92 EXPECT_EQ(20, read_layout.placement_list[0].offset); | 92 EXPECT_EQ(20, read_layout.placement_list[0].offset); |
93 } | 93 } |
94 | 94 |
95 } // namespace ash | 95 } // namespace ash |
OLD | NEW |