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

Side by Side Diff: chrome/browser/cocoa/download_util_mac_unittest.mm

Issue 178037: Make all of our unit tests be PlatformTests to get an autorelease pool.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698