diff options
author | sverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 14:28:24 +0000 |
---|---|---|
committer | sverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 14:28:24 +0000 |
commit | daee4970727d0bb40b9c4f29895e50253ba38d7e (patch) | |
tree | c1435e7a6d6a8429939f32b7e022897db1969144 | |
parent | bd0b780ba75bff665e19ee779f0d6920bb6602c2 (diff) | |
download | chromium_src-daee4970727d0bb40b9c4f29895e50253ba38d7e.zip chromium_src-daee4970727d0bb40b9c4f29895e50253ba38d7e.tar.gz chromium_src-daee4970727d0bb40b9c4f29895e50253ba38d7e.tar.bz2 |
Re-enable test (disabled while moving printing functionality to printing library).
TEST=Run printing_unittests (no functional change).
BUG=none
Review URL: http://codereview.chromium.org/149288
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20260 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | printing/emf_win_unittest.cc | 24 | ||||
-rw-r--r-- | printing/printing_context_win.cc | 5 | ||||
-rw-r--r-- | printing/test/data/test4.emf (renamed from chrome/test/data/printing/test4.emf) | bin | 6488 -> 6488 bytes |
3 files changed, 14 insertions, 15 deletions
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc index 7f1a1e6..c3846f3 100644 --- a/printing/emf_win_unittest.cc +++ b/printing/emf_win_unittest.cc @@ -8,8 +8,10 @@ #include <wingdi.h> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" +#include "printing/printing_context.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -60,13 +62,6 @@ TEST(EmfTest, DC) { EXPECT_TRUE(DeleteDC(hdc)); } -// TODO(sverrir): Re-enable after win_printing_context has been moved here. -/* - -// DEPS check fails even if include is in a multi line comment: -// #include "printing/printing_context.h" -// #include "chrome/common/chrome_paths.h" - // Disabled if no "UnitTest printer" exist. Useful to reproduce bug 1186598. TEST_F(EmfPrintingTest, Enumerate) { if (IsTestCaseDisabled()) @@ -81,15 +76,16 @@ TEST_F(EmfPrintingTest, Enumerate) { printing::PrintingContext context; EXPECT_EQ(context.InitWithSettings(settings), printing::PrintingContext::OK); - std::wstring test_file; - PathService::Get(chrome::DIR_TEST_DATA, &test_file); - + FilePath emf_file; + EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &emf_file)); + emf_file = emf_file.Append(FILE_PATH_LITERAL("printing")) + .Append(FILE_PATH_LITERAL("test")) + .Append(FILE_PATH_LITERAL("data")) + .Append(FILE_PATH_LITERAL("test4.emf")); // Load any EMF with an image. printing::Emf emf; - file_util::AppendToPath(&test_file, L"printing"); - file_util::AppendToPath(&test_file, L"test4.emf"); std::string emf_data; - file_util::ReadFileToString(test_file, &emf_data); + file_util::ReadFileToString(emf_file, &emf_data); ASSERT_TRUE(emf_data.size()); EXPECT_TRUE(emf.CreateFromData(&emf_data[0], emf_data.size())); @@ -116,4 +112,4 @@ TEST_F(EmfPrintingTest, Enumerate) { context.PageDone(); context.DocumentDone(); } -*/ + diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc index 4e506a5..8706b05 100644 --- a/printing/printing_context_win.cc +++ b/printing/printing_context_win.cc @@ -288,7 +288,10 @@ PrintingContext::Result PrintingContext::NewDocument( di.lpszOutput = debug_dump_path.c_str(); } - DCHECK_EQ(MessageLoop::current()->NestableTasksAllowed(), false); + // No message loop running in unit tests. + DCHECK(!MessageLoop::current() ? true : + !MessageLoop::current()->NestableTasksAllowed()); + // Begin a print job by calling the StartDoc function. // NOTE: StartDoc() starts a message loop. That causes a lot of problems with // IPC. Make sure recursive task processing is disabled. diff --git a/chrome/test/data/printing/test4.emf b/printing/test/data/test4.emf Binary files differindex 3a62454..3a62454 100644 --- a/chrome/test/data/printing/test4.emf +++ b/printing/test/data/test4.emf |