| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/common/win_util.h" | 5 #include "app/win_util.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 TEST(WinUtilTest, EnsureRectIsVisibleInRect) { | 8 TEST(WinUtilTest, EnsureRectIsVisibleInRect) { |
| 9 gfx::Rect parent_rect(0, 0, 500, 400); | 9 gfx::Rect parent_rect(0, 0, 500, 400); |
| 10 | 10 |
| 11 { | 11 { |
| 12 // Child rect x < 0 | 12 // Child rect x < 0 |
| 13 gfx::Rect child_rect(-50, 20, 100, 100); | 13 gfx::Rect child_rect(-50, 20, 100, 100); |
| 14 win_util::EnsureRectIsVisibleInRect(parent_rect, &child_rect, 10); | 14 win_util::EnsureRectIsVisibleInRect(parent_rect, &child_rect, 10); |
| 15 EXPECT_EQ(gfx::Rect(10, 20, 100, 100), child_rect); | 15 EXPECT_EQ(gfx::Rect(10, 20, 100, 100), child_rect); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 TEST(WinUtilTest, AppendingExtensions) { | 86 TEST(WinUtilTest, AppendingExtensions) { |
| 87 for (unsigned int i = 0; i < arraysize(filename_cases); ++i) { | 87 for (unsigned int i = 0; i < arraysize(filename_cases); ++i) { |
| 88 const filename_case& value = filename_cases[i]; | 88 const filename_case& value = filename_cases[i]; |
| 89 std::wstring result = | 89 std::wstring result = |
| 90 win_util::AppendExtensionIfNeeded(value.filename, value.filter_selected, | 90 win_util::AppendExtensionIfNeeded(value.filename, value.filter_selected, |
| 91 value.suggested_ext); | 91 value.suggested_ext); |
| 92 EXPECT_EQ(value.result, result); | 92 EXPECT_EQ(value.result, result); |
| 93 } | 93 } |
| 94 } | 94 } |
| OLD | NEW |