Chromium Code Reviews| Index: components/nacl/common/test_nacl_browser_delegate.h |
| diff --git a/components/nacl/common/test_nacl_browser_delegate.h b/components/nacl/common/test_nacl_browser_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..df066dc9907908217a42d52d57f69e9fc10d6c87 |
| --- /dev/null |
| +++ b/components/nacl/common/test_nacl_browser_delegate.h |
| @@ -0,0 +1,60 @@ |
| +// Copyright 2013 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 COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_ |
| +#define COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_ |
| + |
| +#include "components/nacl/common/nacl_browser_delegate.h" |
| + |
| +// This is a base test implementation of NaClBrowserDelegate, which |
|
Mark Seaborn
2013/10/31 02:36:38
Nit: remove comma, otherwise it looks like you're
jvoung (off chromium)
2013/10/31 16:59:55
Done.
|
| +// does nothing. Individual tests can override the methods further. |
| +// To use the test delegate: |
| +// |
| +// NaClBrowser::SetDelegate(new RefinedTestNaClBrowserDelegate); |
| +// |
| +// and |
| +// |
| +// NaClBrowser::SetDelegate(NULL); // frees the test delegate. |
|
Mark Seaborn
2013/10/31 02:36:38
Indent by 1 more space to match the other SetDeleg
jvoung (off chromium)
2013/10/31 16:59:55
Done.
|
| +class TestNaClBrowserDelegate : public NaClBrowserDelegate { |
| + public: |
| + virtual ~TestNaClBrowserDelegate() {} |
| + virtual void ShowNaClInfobar(int render_process_id, |
| + int render_view_id, |
| + int error_id) OVERRIDE {} |
| + virtual bool DialogsAreSuppressed() OVERRIDE { return false; } |
| + virtual bool GetCacheDirectory(base::FilePath* cache_dir) OVERRIDE { |
| + return false; |
| + } |
| + virtual bool GetPluginDirectory(base::FilePath* plugin_dir) OVERRIDE { |
| + return false; |
| + } |
| + virtual bool GetPnaclDirectory(base::FilePath* pnacl_dir) OVERRIDE { |
| + return false; |
| + } |
| + virtual bool GetUserDirectory(base::FilePath* user_dir) OVERRIDE { |
| + return false; |
| + } |
| + virtual std::string GetVersionString() const OVERRIDE { |
| + return std::string(); |
| + } |
| + virtual ppapi::host::HostFactory* CreatePpapiHostFactory( |
| + content::BrowserPpapiHost* ppapi_host) OVERRIDE { |
| + return NULL; |
| + } |
| + virtual bool MapUrlToLocalFilePath(const GURL& url, |
| + bool use_blocking_api, |
| + base::FilePath* file_path) OVERRIDE { |
| + return false; |
| + } |
| + virtual void TryInstallPnacl(const base::Callback<void(bool)>& installed) |
| + OVERRIDE { |
| + installed.Run(false); |
| + } |
| + virtual void SetDebugPatterns(std::string debug_patterns) OVERRIDE {} |
| + virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) OVERRIDE { |
| + return false; |
| + } |
| +}; |
| + |
| +#endif // COMPONENTS_NACL_COMMON_TEST_NACL_BROWSER_DELEGATE_H_ |