diff options
author | raymes@google.com <raymes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-21 17:58:24 +0000 |
---|---|---|
committer | raymes@google.com <raymes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-21 17:58:24 +0000 |
commit | 4d80a3dba1592f7429b784fd751a8ad94399fbfa (patch) | |
tree | bf2d4e820765840b7828132bdf51e0191ba2da2b /ppapi/tests | |
parent | 114313bc5ba93b9a952f07da1224b22ae7011154 (diff) | |
download | chromium_src-4d80a3dba1592f7429b784fd751a8ad94399fbfa.zip chromium_src-4d80a3dba1592f7429b784fd751a8ad94399fbfa.tar.gz chromium_src-4d80a3dba1592f7429b784fd751a8ad94399fbfa.tar.bz2 |
Revert 143294 - Provides a real implementation of GetDefaultPrintSettings.
Reverting due to: http://code.google.com/p/chromium/issues/detail?id=133972
This accesses the Chrome printing code to determine the default print settings for the default printer. Ideally we would query these settings every time they are requested, however this cannot be done (see the description in pepper_print_settings_initializer.h). Instead the settings are grabbed once at startup and cached.
BUG=
TEST=Added ppapi test.
Review URL: https://chromiumcodereview.appspot.com/10539171
TBR=raymes@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10633008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143409 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests')
-rw-r--r-- | ppapi/tests/test_printing.cc | 52 | ||||
-rw-r--r-- | ppapi/tests/test_printing.h | 24 |
2 files changed, 0 insertions, 76 deletions
diff --git a/ppapi/tests/test_printing.cc b/ppapi/tests/test_printing.cc deleted file mode 100644 index e459524..0000000 --- a/ppapi/tests/test_printing.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/tests/test_printing.h" - -#include "ppapi/cpp/dev/printing_dev.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/tests/testing_instance.h" - -REGISTER_TEST_CASE(Printing); - -class TestPrinting_Dev : public pp::Printing_Dev { -public: - explicit TestPrinting_Dev(pp::Instance* instance) : - pp::Printing_Dev(instance) {} - virtual ~TestPrinting_Dev() {} - virtual uint32_t QuerySupportedPrintOutputFormats() { return 0; } - virtual int32_t PrintBegin( - const PP_PrintSettings_Dev& print_settings) { return 0; } - virtual pp::Resource PrintPages( - const PP_PrintPageNumberRange_Dev* page_ranges, - uint32_t page_range_count) { - return pp::Resource(); - } - virtual void PrintEnd() {} - virtual bool IsPrintScalingDisabled() { return false; } -}; - -TestPrinting::TestPrinting(TestingInstance* instance) - : TestCase(instance) { -} - -void TestPrinting::RunTests(const std::string& filter) { - RUN_TEST(GetDefaultPrintSettings, filter); -} - -std::string TestPrinting::TestGetDefaultPrintSettings() { - PP_PrintSettings_Dev print_settings; - bool success = - TestPrinting_Dev(instance_).GetDefaultPrintSettings(&print_settings); - ASSERT_TRUE(success); - // We can't check any margin values because we don't know what they will be, - // but the following are currently hard-coded. - ASSERT_EQ(print_settings.orientation, PP_PRINTORIENTATION_NORMAL); - ASSERT_EQ( - print_settings.print_scaling_option, PP_PRINTSCALINGOPTION_SOURCE_SIZE); - ASSERT_EQ(print_settings.grayscale, PP_FALSE); - ASSERT_EQ(print_settings.format, PP_PRINTOUTPUTFORMAT_PDF); - - PASS(); -} diff --git a/ppapi/tests/test_printing.h b/ppapi/tests/test_printing.h deleted file mode 100644 index 6b494b6..0000000 --- a/ppapi/tests/test_printing.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_TESTS_TEST_PRINTING_H_ -#define PPAPI_TESTS_TEST_PRINTING_H_ - -#include <string> - -#include "ppapi/tests/test_case.h" - -class TestPrinting : public TestCase { - public: - explicit TestPrinting(TestingInstance* instance); - - // TestCase implementation. - virtual void RunTests(const std::string& filter); - - private: - // Tests. - std::string TestGetDefaultPrintSettings(); -}; - -#endif // PPAPI_TESTS_TEST_PRINTING_H_ |