test_nacl_browser_delegate.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_
  5. #define COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_
  6. #include "base/compiler_specific.h"
  7. #include "components/nacl/browser/nacl_browser_delegate.h"
  8. // This is a base test implementation of NaClBrowserDelegate which
  9. // does nothing. Individual tests can override the methods further.
  10. // To use the test delegate:
  11. //
  12. // NaClBrowser::SetDelegate(new RefinedTestNaClBrowserDelegate);
  13. //
  14. // and
  15. //
  16. // NaClBrowser::ClearAndDeleteDelegateForTest();
  17. class TestNaClBrowserDelegate : public NaClBrowserDelegate {
  18. public:
  19. TestNaClBrowserDelegate();
  20. TestNaClBrowserDelegate(const TestNaClBrowserDelegate&) = delete;
  21. TestNaClBrowserDelegate& operator=(const TestNaClBrowserDelegate&) = delete;
  22. ~TestNaClBrowserDelegate() override;
  23. void ShowMissingArchInfobar(int render_process_id,
  24. int render_frame_id) override;
  25. bool DialogsAreSuppressed() override;
  26. bool GetCacheDirectory(base::FilePath* cache_dir) override;
  27. bool GetPluginDirectory(base::FilePath* plugin_dir) override;
  28. bool GetPnaclDirectory(base::FilePath* pnacl_dir) override;
  29. bool GetUserDirectory(base::FilePath* user_dir) override;
  30. std::string GetVersionString() const override;
  31. ppapi::host::HostFactory* CreatePpapiHostFactory(
  32. content::BrowserPpapiHost* ppapi_host) override;
  33. MapUrlToLocalFilePathCallback GetMapUrlToLocalFilePathCallback(
  34. const base::FilePath& profile_directory) override;
  35. void SetDebugPatterns(const std::string& debug_patterns) override;
  36. bool URLMatchesDebugPatterns(const GURL& manifest_url) override;
  37. };
  38. #endif // COMPONENTS_NACL_BROWSER_TEST_NACL_BROWSER_DELEGATE_H_