Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: ui/shell_dialogs/select_file_dialog_win_unittest.cc

Issue 15200005: Grab bag of clang fixes for Windows code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ptr and cast style Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/leveldatabase/port/port_chromium.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/shell_dialogs/select_file_dialog.h" 6 #include "ui/shell_dialogs/select_file_dialog.h"
7 #include "ui/shell_dialogs/select_file_dialog_win.h" 7 #include "ui/shell_dialogs/select_file_dialog_win.h"
8 8
9 TEST(ShellDialogsWin, AppendExtensionIfNeeded) { 9 TEST(ShellDialogsWin, AppendExtensionIfNeeded) {
10 struct AppendExtensionTestCase { 10 struct AppendExtensionTestCase {
11 wchar_t* filename; 11 const wchar_t* filename;
12 wchar_t* filter_selected; 12 const wchar_t* filter_selected;
13 wchar_t* suggested_ext; 13 const wchar_t* suggested_ext;
14 wchar_t* expected_filename; 14 const wchar_t* expected_filename;
15 } test_cases[] = { 15 } test_cases[] = {
16 // Known extensions, with or without associated MIME types, should not get 16 // Known extensions, with or without associated MIME types, should not get
17 // an extension appended. 17 // an extension appended.
18 { L"sample.html", L"*.txt", L"txt", L"sample.html" }, 18 { L"sample.html", L"*.txt", L"txt", L"sample.html" },
19 { L"sample.reg", L"*.txt", L"txt", L"sample.reg" }, 19 { L"sample.reg", L"*.txt", L"txt", L"sample.reg" },
20 20
21 // An unknown extension, or no extension, should get the default extension 21 // An unknown extension, or no extension, should get the default extension
22 // appended. 22 // appended.
23 { L"sample.unknown", L"*.txt", L"txt", L"sample.unknown.txt" }, 23 { L"sample.unknown", L"*.txt", L"txt", L"sample.unknown.txt" },
24 { L"sample", L"*.txt", L"txt", L"sample.txt" }, 24 { L"sample", L"*.txt", L"txt", L"sample.txt" },
(...skipping 12 matching lines...) Expand all
37 }; 37 };
38 38
39 for (size_t i = 0; i < arraysize(test_cases); ++i) { 39 for (size_t i = 0; i < arraysize(test_cases); ++i) {
40 EXPECT_EQ(std::wstring(test_cases[i].expected_filename), 40 EXPECT_EQ(std::wstring(test_cases[i].expected_filename),
41 ui::AppendExtensionIfNeeded(test_cases[i].filename, 41 ui::AppendExtensionIfNeeded(test_cases[i].filename,
42 test_cases[i].filter_selected, 42 test_cases[i].filter_selected,
43 test_cases[i].suggested_ext)); 43 test_cases[i].suggested_ext));
44 } 44 }
45 } 45 }
46 46
OLDNEW
« no previous file with comments | « third_party/leveldatabase/port/port_chromium.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698