test_file_chooser.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2015 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 PPAPI_TESTS_TEST_FILE_CHOOSER_H_
  5. #define PPAPI_TESTS_TEST_FILE_CHOOSER_H_
  6. #include "ppapi/tests/test_case.h"
  7. namespace pp {
  8. class FileRef;
  9. }
  10. class TestFileChooser : public TestCase {
  11. public:
  12. TestFileChooser(TestingInstance* instance) : TestCase(instance) {}
  13. // TestCase
  14. bool Init() override;
  15. void RunTests(const std::string& filter) override;
  16. private:
  17. // Writes the string "Hello from PPAPI" into the file represented by
  18. // |file_ref|. Returns true on success.
  19. bool WriteDefaultContentsToFile(const pp::FileRef& file_ref);
  20. std::string TestOpenSimple();
  21. std::string TestOpenCancel();
  22. std::string TestSaveAsSafeDefaultName();
  23. std::string TestSaveAsUnsafeDefaultName();
  24. std::string TestSaveAsCancel();
  25. std::string TestSaveAsDangerousExecutableAllowed();
  26. std::string TestSaveAsDangerousExecutableDisallowed();
  27. std::string TestSaveAsDangerousExtensionListDisallowed();
  28. };
  29. #endif // PPAPI_TESTS_TEST_FILE_CHOOSER_H_