Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / renderer / printing / print_web_view_helper_browsertest.cc
index ba5cc26..aac87f0 100644 (file)
@@ -31,11 +31,11 @@ namespace printing {
 
 namespace {
 
+#if !defined(OS_CHROMEOS)
+
 // A simple web page.
 const char kHelloWorldHTML[] = "<body><p>Hello World!</p></body>";
 
-#if !defined(OS_CHROMEOS)
-
 // A simple webpage with a button to print itself with.
 const char kPrintOnUserAction[] =
     "<body>"
@@ -110,7 +110,7 @@ class DidPreviewPageListener : public IPC::Listener {
   explicit DidPreviewPageListener(base::RunLoop* run_loop)
       : run_loop_(run_loop) {}
 
-  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
+  bool OnMessageReceived(const IPC::Message& message) override {
     if (message.type() == PrintHostMsg_MetafileReadyForPrinting::ID ||
         message.type() == PrintHostMsg_PrintPreviewFailed::ID ||
         message.type() == PrintHostMsg_PrintPreviewCancelled::ID)
@@ -128,7 +128,7 @@ class DidPreviewPageListener : public IPC::Listener {
 class PrintWebViewHelperTestBase : public ChromeRenderViewTest {
  public:
   PrintWebViewHelperTestBase() {}
-  virtual ~PrintWebViewHelperTestBase() {}
+  ~PrintWebViewHelperTestBase() override {}
 
  protected:
   void PrintWithJavaScript() {
@@ -189,12 +189,12 @@ class PrintWebViewHelperTestBase : public ChromeRenderViewTest {
 #endif  // defined(OS_CHROMEOS)
   }
 
-#if !defined(DISABLE_BASIC_PRINTING)
+#if defined(ENABLE_BASIC_PRINTING)
   void OnPrintPages() {
     PrintWebViewHelper::Get(view_)->OnPrintPages();
     ProcessPendingMessages();
   }
-#endif  // !DISABLE_BASIC_PRINTING
+#endif  // ENABLE_BASIC_PRINTING
 
   void VerifyPreviewRequest(bool requested) {
     const IPC::Message* print_msg =
@@ -226,18 +226,16 @@ class PrintWebViewHelperTestBase : public ChromeRenderViewTest {
 class PrintWebViewHelperTest : public PrintWebViewHelperTestBase {
  public:
   PrintWebViewHelperTest() {}
-  virtual ~PrintWebViewHelperTest() {}
+  ~PrintWebViewHelperTest() override {}
 
-  virtual void SetUp() OVERRIDE {
-    ChromeRenderViewTest::SetUp();
-  }
+  void SetUp() override { ChromeRenderViewTest::SetUp(); }
 
  protected:
   DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperTest);
 };
 
 // This tests only for platforms without print preview.
-#if !defined(ENABLE_FULL_PRINTING)
+#if !defined(ENABLE_PRINT_PREVIEW)
 // Tests that the renderer blocks window.print() calls if they occur too
 // frequently.
 TEST_F(PrintWebViewHelperTest, BlockScriptInitiatedPrinting) {
@@ -308,9 +306,9 @@ TEST_F(PrintWebViewHelperTest, PrintWithJavascript) {
   VerifyPageCount(1);
   VerifyPagesPrinted(true);
 }
-#endif  // !ENABLE_FULL_PRINTING
+#endif  // !ENABLE_PRINT_PREVIEW
 
-#if !defined(DISABLE_BASIC_PRINTING)
+#if defined(ENABLE_BASIC_PRINTING)
 // Tests that printing pages work and sending and receiving messages through
 // that channel all works.
 TEST_F(PrintWebViewHelperTest, OnPrintPages) {
@@ -320,9 +318,9 @@ TEST_F(PrintWebViewHelperTest, OnPrintPages) {
   VerifyPageCount(1);
   VerifyPagesPrinted(true);
 }
-#endif  // !DISABLE_BASIC_PRINTING
+#endif  // ENABLE_BASIC_PRINTING
 
-#if defined(OS_MACOSX) && !defined(DISABLE_BASIC_PRINTING)
+#if defined(OS_MACOSX) && defined(ENABLE_BASIC_PRINTING)
 // TODO(estade): I don't think this test is worth porting to Linux. We will have
 // to rip out and replace most of the IPC code if we ever plan to improve
 // printing, and the comment below by sverrir suggests that it doesn't do much
@@ -364,7 +362,7 @@ TEST_F(PrintWebViewHelperTest, PrintWithIframe) {
   EXPECT_NE(0, image1.size().width());
   EXPECT_NE(0, image1.size().height());
 }
-#endif  // OS_MACOSX && !DISABLE_BASIC_PRINTING
+#endif  // OS_MACOSX && ENABLE_BASIC_PRINTING
 
 // Tests if we can print a page and verify its results.
 // This test prints HTML pages into a pseudo printer and check their outputs,
@@ -410,7 +408,7 @@ const TestPageData kTestPages[] = {
 // hooking up Cairo to read a pdf stream, or accessing the cairo surface in the
 // metafile directly.
 // Same for printing via PDF on Windows.
-#if defined(OS_MACOSX) && !defined(DISABLE_BASIC_PRINTING)
+#if defined(OS_MACOSX) && defined(ENABLE_BASIC_PRINTING)
 TEST_F(PrintWebViewHelperTest, PrintLayoutTest) {
   bool baseline = false;
 
@@ -463,14 +461,14 @@ TEST_F(PrintWebViewHelperTest, PrintLayoutTest) {
     }
   }
 }
-#endif  // OS_MACOSX && !DISABLE_BASIC_PRINTING
+#endif  // OS_MACOSX && ENABLE_BASIC_PRINTING
 
 // These print preview tests do not work on Chrome OS yet.
 #if !defined(OS_CHROMEOS)
 class PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase {
  public:
   PrintWebViewHelperPreviewTest() {}
-  virtual ~PrintWebViewHelperPreviewTest() {}
+  ~PrintWebViewHelperPreviewTest() override {}
 
  protected:
   void VerifyPrintPreviewCancelled(bool did_cancel) {
@@ -562,7 +560,7 @@ class PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase {
   DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperPreviewTest);
 };
 
-#if defined(ENABLE_FULL_PRINTING)
+#if defined(ENABLE_PRINT_PREVIEW)
 TEST_F(PrintWebViewHelperPreviewTest, BlockScriptInitiatedPrinting) {
   LoadHTML(kHelloWorldHTML);
   PrintWebViewHelper* print_web_view_helper = PrintWebViewHelper::Get(view_);
@@ -594,7 +592,7 @@ TEST_F(PrintWebViewHelperPreviewTest, PrintWithJavaScript) {
 
   VerifyPreviewRequest(true);
 }
-#endif  // ENABLE_FULL_PRINTING
+#endif  // ENABLE_PRINT_PREVIEW
 
 // Tests that print preview work and sending and receiving messages through
 // that channel all works.