summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 20:57:57 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 20:57:57 +0000
commitf21104d2af372e6e2b73a01eab5b55ed19af462a (patch)
tree324c52ffa0547f683d7fe1962b3428d91a66a4dd /printing
parent091cb24cf6e999b844ac323113dfd7c645a85711 (diff)
downloadchromium_src-f21104d2af372e6e2b73a01eab5b55ed19af462a.zip
chromium_src-f21104d2af372e6e2b73a01eab5b55ed19af462a.tar.gz
chromium_src-f21104d2af372e6e2b73a01eab5b55ed19af462a.tar.bz2
Used ScopedTempDir dir for the FileBackedDC unit test.
BUG=None TEST=Printing unittests. Review URL: http://codereview.chromium.org/3535011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62013 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/emf_win_unittest.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc
index d0e9684..b0f721c 100644
--- a/printing/emf_win_unittest.cc
+++ b/printing/emf_win_unittest.cc
@@ -14,6 +14,7 @@
#include "base/path_service.h"
#include "base/scoped_handle_win.h"
#include "base/scoped_ptr.h"
+#include "base/scoped_temp_dir.h"
#include "printing/printing_context.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -162,8 +163,11 @@ TEST(EmfTest, FileBackedDC) {
RECT rect = {100, 100, 200, 200};
HDC hdc = CreateCompatibleDC(NULL);
EXPECT_TRUE(hdc != NULL);
+ ScopedTempDir scratch_metafile_dir;
+ ASSERT_TRUE(scratch_metafile_dir.CreateUniqueTempDir());
FilePath metafile_path;
- EXPECT_TRUE(file_util::CreateTemporaryFile(&metafile_path));
+ EXPECT_TRUE(file_util::CreateTemporaryFileInDir(scratch_metafile_dir.path(),
+ &metafile_path));
EXPECT_TRUE(emf.CreateFileBackedDc(hdc, &rect, metafile_path));
EXPECT_TRUE(emf.hdc() != NULL);
// In theory, you'd use the HDC with GDI functions here.
@@ -187,5 +191,6 @@ TEST(EmfTest, FileBackedDC) {
RECT output_rect = {0, 0, 10, 10};
EXPECT_TRUE(emf.Playback(hdc, &output_rect));
EXPECT_TRUE(DeleteDC(hdc));
+ emf.CloseEmf();
}