Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
James Cook
2016/04/29 20:33:19
Can this unit test also move into ash/wm/common?
| |
| 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/wm/workspace/magnetism_matcher.h" | 5 #include "ash/wm/common/workspace/magnetism_matcher.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace ash { | 9 namespace ash { |
| 10 | 10 |
| 11 // Trivial test case verifying assertions on left edge. | 11 // Trivial test case verifying assertions on left edge. |
| 12 TEST(MagnetismMatcherTest, TrivialLeft) { | 12 TEST(MagnetismMatcherTest, TrivialLeft) { |
| 13 const int distance = MagnetismMatcher::kMagneticDistance; | 13 const int distance = MagnetismMatcher::kMagneticDistance; |
| 14 const gfx::Rect initial_bounds(20, 10, 50, 60); | 14 const gfx::Rect initial_bounds(20, 10, 50, 60); |
| 15 MagnetismMatcher matcher(initial_bounds, kAllMagnetismEdges); | 15 MagnetismMatcher matcher(initial_bounds, kAllMagnetismEdges); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 // Should match the following which extends into non-overlapping region. | 160 // Should match the following which extends into non-overlapping region. |
| 161 EXPECT_TRUE(matcher.ShouldAttach( | 161 EXPECT_TRUE(matcher.ShouldAttach( |
| 162 gfx::Rect(initial_bounds.x() - 4, | 162 gfx::Rect(initial_bounds.x() - 4, |
| 163 140, 3, 20), &edge)); | 163 140, 3, 20), &edge)); |
| 164 EXPECT_EQ(MAGNETISM_EDGE_LEFT, edge.primary_edge); | 164 EXPECT_EQ(MAGNETISM_EDGE_LEFT, edge.primary_edge); |
| 165 EXPECT_EQ(SECONDARY_MAGNETISM_EDGE_NONE, edge.secondary_edge); | 165 EXPECT_EQ(SECONDARY_MAGNETISM_EDGE_NONE, edge.secondary_edge); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace ash | 168 } // namespace ash |
| 169 | 169 |
| OLD | NEW |