summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 19:42:54 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 19:42:54 +0000
commit94fdd85d840fa2d3a8ba4f46241cc53f0b1c05d8 (patch)
treebab9d9d0d6d816d585553bf2ada2288562f1cda7
parent761a23dc57767c16599b03df11547cc810d31968 (diff)
downloadchromium_src-94fdd85d840fa2d3a8ba4f46241cc53f0b1c05d8.zip
chromium_src-94fdd85d840fa2d3a8ba4f46241cc53f0b1c05d8.tar.gz
chromium_src-94fdd85d840fa2d3a8ba4f46241cc53f0b1c05d8.tar.bz2
Reset AssertHandler in IPCMessageTest.Metafile.
BUG=55177 TEST=Unit tests Review URL: http://codereview.chromium.org/4660011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65972 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/common_param_traits_unittest.cc24
-rw-r--r--printing/emf_win.cc1
2 files changed, 4 insertions, 21 deletions
diff --git a/chrome/common/common_param_traits_unittest.cc b/chrome/common/common_param_traits_unittest.cc
index 48b08f8..6086c12 100644
--- a/chrome/common/common_param_traits_unittest.cc
+++ b/chrome/common/common_param_traits_unittest.cc
@@ -18,15 +18,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#if defined(OS_WIN)
-#ifndef NDEBUG
-namespace {
-void IgnoreAssertHandler(const std::string& str) {
-}
-} // namespace
-#endif // NDEBUG
-#endif // defined(OS_WIN)
-
// Tests that serialize/deserialize correctly understand each other
TEST(IPCMessageTest, Serialize) {
const char* serialize_cases[] = {
@@ -234,12 +225,11 @@ TEST(IPCMessageTest, PageRange) {
EXPECT_TRUE(input == output);
}
-// Enabling this test breaks assert handling for test suite. Bug 55177.
// Tests printing::NativeMetafile serialization.
-TEST(IPCMessageTest, DISABLED_Metafile) {
- // TODO(sanjeevr): Make this test meaningful for non-Windows platforms. We
- // need to initialize the metafile using alternate means on the other OSes.
+// TODO(sanjeevr): Make this test meaningful for non-Windows platforms. We
+// need to initialize the metafile using alternate means on the other OSes.
#if defined(OS_WIN)
+TEST(IPCMessageTest, Metafile) {
printing::NativeMetafile metafile;
RECT test_rect = {0, 0, 100, 100};
// Create a metsfile using the screen DC as a reference.
@@ -269,14 +259,8 @@ TEST(IPCMessageTest, DISABLED_Metafile) {
// Make sure we don't read out the metafile!
printing::NativeMetafile bad_output;
iter = NULL;
- // The Emf code on Windows DCHECKs if it cannot create the metafile.
-#ifndef NDEBUG
- logging::SetLogAssertHandler(IgnoreAssertHandler);
-#endif // NDEBUG
EXPECT_FALSE(IPC::ParamTraits<printing::NativeMetafile>::Read(
&bad_msg, &iter, &bad_output));
-#else // defined(OS_WIN)
- NOTIMPLEMENTED();
-#endif // defined(OS_WIN)
}
+#endif // defined(OS_WIN)
diff --git a/printing/emf_win.cc b/printing/emf_win.cc
index 1a7c8dd..9629bb2 100644
--- a/printing/emf_win.cc
+++ b/printing/emf_win.cc
@@ -58,7 +58,6 @@ bool Emf::Init(const void* src_buffer, uint32 src_buffer_size) {
DCHECK(!emf_ && !hdc_);
emf_ = SetEnhMetaFileBits(src_buffer_size,
reinterpret_cast<const BYTE*>(src_buffer));
- DCHECK(emf_);
return emf_ != NULL;
}