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

Unified Diff: printing/emf_win_unittest.cc

Issue 478183005: Added PrintingContext::Delegate to get parent view handle and application locale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: printing/emf_win_unittest.cc
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc
index 8a5daaff4ef064d40fb1bf64978bf5df1ca92fc8..ec65c2844a964857bb98f4bfcfcf10a762d6b585 100644
--- a/printing/emf_win_unittest.cc
+++ b/printing/emf_win_unittest.cc
@@ -22,11 +22,13 @@
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
+namespace printing {
+
namespace {
// This test is automatically disabled if no printer named "UnitTest Printer" is
// available.
-class EmfPrintingTest : public testing::Test {
+class EmfPrintingTest : public testing::Test, public PrintingContext::Delegate {
public:
typedef testing::Test Parent;
static bool IsTestCaseDisabled() {
@@ -37,14 +39,16 @@ class EmfPrintingTest : public testing::Test {
DeleteDC(hdc);
return false;
}
+
+ // PrintingContext::Delegate methods.
+ virtual gfx::NativeView GetParentView() OVERRIDE { return NULL; }
+ virtual std::string GetAppLocale() OVERRIDE { return std::string(); }
};
const uint32 EMF_HEADER_SIZE = 128;
} // namespace
-namespace printing {
-
TEST(EmfTest, DC) {
// Simplest use case.
uint32 size;
@@ -83,7 +87,7 @@ TEST_F(EmfPrintingTest, Enumerate) {
settings.set_device_name(L"UnitTest Printer");
// Initialize it.
- scoped_ptr<PrintingContext> context(PrintingContext::Create(std::string()));
+ scoped_ptr<PrintingContext> context(PrintingContext::Create(this));
EXPECT_EQ(context->InitWithSettings(settings), PrintingContext::OK);
base::FilePath emf_file;

Powered by Google App Engine
This is Rietveld 408576698