Index: sky/viewer/viewer.cc |
diff --git a/sky/viewer/viewer.cc b/sky/viewer/viewer.cc |
index eb5b6d0fba31b3bb14f243cf89fbfd4146359401..26a070f783d8ba0a8a885314abef23afcdc5d53c 100644 |
--- a/sky/viewer/viewer.cc |
+++ b/sky/viewer/viewer.cc |
@@ -24,6 +24,9 @@ |
namespace sky { |
+// Load the viewer in testing mode so we can dump pixels. |
+const char kTesting[] = "--testing"; |
+ |
class Viewer : public mojo::ApplicationDelegate, |
public mojo::InterfaceFactory<mojo::ContentHandler> { |
public: |
@@ -34,6 +37,8 @@ class Viewer : public mojo::ApplicationDelegate, |
private: |
// Overridden from ApplicationDelegate: |
virtual void Initialize(mojo::ApplicationImpl* app) override { |
+ is_testing_ = app->HasArg(kTesting); |
+ |
platform_impl_.reset(new PlatformImpl(app)); |
blink::initialize(platform_impl_.get()); |
base::i18n::InitializeICU(); |
@@ -50,10 +55,11 @@ class Viewer : public mojo::ApplicationDelegate, |
// Overridden from InterfaceFactory<ContentHandler> |
virtual void Create(mojo::ApplicationConnection* connection, |
mojo::InterfaceRequest<mojo::ContentHandler> request) override { |
- mojo::BindToRequest(new ContentHandlerImpl(), &request); |
+ mojo::BindToRequest(new ContentHandlerImpl(is_testing_), &request); |
} |
scoped_ptr<PlatformImpl> platform_impl_; |
+ bool is_testing_; |
DISALLOW_COPY_AND_ASSIGN(Viewer); |
}; |