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 "app/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 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 {L"f.jpg", L"*.*", L"jpg", L"f.jpg"}, | 75 {L"f.jpg", L"*.*", L"jpg", L"f.jpg"}, |
76 {L"f.jpeg", L"*.*", L"jpg", L"f.jpeg"}, // Same MIME type (diff. ext). | 76 {L"f.jpeg", L"*.*", L"jpg", L"f.jpeg"}, // Same MIME type (diff. ext). |
77 // Test the empty filter, which should behave identically to the | 77 // Test the empty filter, which should behave identically to the |
78 // All Files filter. | 78 // All Files filter. |
79 {L"f", L"", L"jpg", L"f"}, | 79 {L"f", L"", L"jpg", L"f"}, |
80 {L"f.", L"", L"jpg", L"f"}, | 80 {L"f.", L"", L"jpg", L"f"}, |
81 {L"f..", L"", L"jpg", L"f"}, | 81 {L"f..", L"", L"jpg", L"f"}, |
82 {L"f.jpg", L"", L"jpg", L"f.jpg"}, | 82 {L"f.jpg", L"", L"jpg", L"f.jpg"}, |
83 {L"f.jpeg", L"", L"jpg", L"f.jpeg"}, | 83 {L"f.jpeg", L"", L"jpg", L"f.jpeg"}, |
84 }; | 84 }; |
85 | |
86 TEST(WinUtilTest, AppendingExtensions) { | |
87 for (unsigned int i = 0; i < arraysize(filename_cases); ++i) { | |
88 const filename_case& value = filename_cases[i]; | |
89 std::wstring result = | |
90 win_util::AppendExtensionIfNeeded(value.filename, value.filter_selected, | |
91 value.suggested_ext); | |
92 EXPECT_EQ(value.result, result); | |
93 } | |
94 } | |
OLD | NEW |