OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Download utility test for Mac OS X. | 5 // Download utility test for Mac OS X. |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
10 #import "chrome/browser/cocoa/download_util_mac.h" | 10 #import "chrome/browser/cocoa/download_util_mac.h" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "testing/platform_test.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 class DownloadUtilTest : public testing::Test { | 17 class DownloadUtilTest : public PlatformTest { |
17 public: | 18 public: |
18 CocoaTestHelper cocoa_helper_; | 19 CocoaTestHelper cocoa_helper_; |
19 }; | 20 }; |
20 | 21 |
21 // Ensure adding files to the pasteboard methods works as expected. | 22 // Ensure adding files to the pasteboard methods works as expected. |
22 TEST_F(DownloadUtilTest, AddFileToPasteboardTest) { | 23 TEST_F(DownloadUtilTest, AddFileToPasteboardTest) { |
23 // Create a pasteboard. | 24 // Create a pasteboard. |
24 NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName]; | 25 NSPasteboard* pasteboard = [NSPasteboard pasteboardWithUniqueName]; |
25 | 26 |
26 // Get a download test file for addition to the pasteboard. | 27 // Get a download test file for addition to the pasteboard. |
(...skipping 12 matching lines...) Expand all Loading... |
39 | 40 |
40 // Ensure the path is what we expect. | 41 // Ensure the path is what we expect. |
41 NSArray* files = [pasteboard propertyListForType:NSFilenamesPboardType]; | 42 NSArray* files = [pasteboard propertyListForType:NSFilenamesPboardType]; |
42 ASSERT_TRUE(files != nil); | 43 ASSERT_TRUE(files != nil); |
43 NSString* expectedPath = [files objectAtIndex:0]; | 44 NSString* expectedPath = [files objectAtIndex:0]; |
44 NSString* realPath = base::SysWideToNSString(testPath.ToWStringHack()); | 45 NSString* realPath = base::SysWideToNSString(testPath.ToWStringHack()); |
45 EXPECT_TRUE([expectedPath isEqualToString:realPath]); | 46 EXPECT_TRUE([expectedPath isEqualToString:realPath]); |
46 } | 47 } |
47 | 48 |
48 } // namespace | 49 } // namespace |
OLD | NEW |