Chromium Code Reviews| Index: chrome/browser/nacl_host/nacl_file_host_unittest.cc |
| diff --git a/chrome/browser/nacl_host/nacl_file_host_unittest.cc b/chrome/browser/nacl_host/nacl_file_host_unittest.cc |
| index 886c5c058795faadd606d14d74b4e2e37918ff02..e3d9ca3249871934487b6ae9db7be0ef41620fe9 100644 |
| --- a/chrome/browser/nacl_host/nacl_file_host_unittest.cc |
| +++ b/chrome/browser/nacl_host/nacl_file_host_unittest.cc |
| @@ -11,8 +11,8 @@ |
| #include "base/test/scoped_path_override.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| #include "chrome/browser/nacl_host/nacl_browser.h" |
| -#include "components/nacl/common/nacl_browser_delegate.h" |
| #include "components/nacl/common/pnacl_types.h" |
| +#include "components/nacl/common/test_nacl_browser_delegate.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/test/test_browser_thread_bundle.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -20,61 +20,17 @@ |
| using nacl_file_host::PnaclCanOpenFile; |
| using nacl_file_host::EnsurePnaclInstalled; |
| -class TestNaClBrowserDelegate : public NaClBrowserDelegate { |
| +class FileHostTestNaclBrowserDelegate : public TestNaClBrowserDelegate { |
|
Mark Seaborn
2013/10/31 02:36:38
Can you fix the spelling to be "NaCl" not "Nacl" h
jvoung (off chromium)
2013/10/31 16:59:55
Done.
|
| public: |
| - |
| - TestNaClBrowserDelegate() : should_pnacl_install_succeed_(false) { } |
| - |
| - 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; |
| - } |
| + FileHostTestNaclBrowserDelegate() : should_pnacl_install_succeed_(false) {} |
| virtual bool GetPnaclDirectory(base::FilePath* pnacl_dir) OVERRIDE { |
| *pnacl_dir = pnacl_path_; |
| return true; |
| } |
| - 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& file_url, |
| - bool use_blocking_api, |
| - base::FilePath* file_path) OVERRIDE { |
| - return false; |
| - } |
| - |
| - virtual void SetDebugPatterns(std::string debug_patterns) OVERRIDE { |
| - } |
| - |
| - virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) OVERRIDE { |
| - return false; |
| - } |
| - |
| - virtual void TryInstallPnacl( |
| - const base::Callback<void(bool)>& installed) OVERRIDE { |
| + virtual void TryInstallPnacl(const base::Callback<void(bool)>& installed) |
| + OVERRIDE { |
| installed.Run(should_pnacl_install_succeed_); |
| } |
| @@ -99,7 +55,7 @@ class NaClFileHostTest : public testing::Test { |
| virtual ~NaClFileHostTest(); |
| virtual void SetUp() OVERRIDE { |
| - nacl_browser_delegate_ = new TestNaClBrowserDelegate; |
| + nacl_browser_delegate_ = new FileHostTestNaclBrowserDelegate; |
| NaClBrowser::SetDelegate(nacl_browser_delegate_); |
| } |
| @@ -107,7 +63,7 @@ class NaClFileHostTest : public testing::Test { |
| NaClBrowser::SetDelegate(NULL); // This deletes nacl_browser_delegate_ |
| } |
| - TestNaClBrowserDelegate* nacl_browser_delegate() { |
| + FileHostTestNaclBrowserDelegate* nacl_browser_delegate() { |
| return nacl_browser_delegate_; |
| } |
| @@ -148,7 +104,7 @@ class NaClFileHostTest : public testing::Test { |
| INSTALL_DONE, |
| INSTALL_PROGRESS |
| }; |
| - TestNaClBrowserDelegate* nacl_browser_delegate_; |
| + FileHostTestNaclBrowserDelegate* nacl_browser_delegate_; |
| bool install_success_; |
| std::vector<EventType> events_; |
| content::TestBrowserThreadBundle thread_bundle_; |