TestControllerManx.cpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (C) 2010 Apple Inc. All rights reserved.
  3. * Copyright (C) 2010 Igalia S.L.
  4. * Copyright (C) 2013 Sony Computer Entertainment Inc.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  19. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  21. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #include "config.h"
  28. #include "TestController.h"
  29. #include <manx/RunLoop.h>
  30. #include <wtf/Platform.h>
  31. #include <wtf/text/WTFString.h>
  32. namespace WTR {
  33. void TestController::notifyDone()
  34. {
  35. Manx::RunLoop::current()->quit();
  36. }
  37. void TestController::platformInitialize()
  38. {
  39. }
  40. void TestController::platformDestroy()
  41. {
  42. }
  43. void TestController::platformRunUntil(bool&, double timeout)
  44. {
  45. Manx::RunLoop::run();
  46. }
  47. void TestController::initializeInjectedBundlePath()
  48. {
  49. m_injectedBundlePath.adopt(WKStringCreateWithUTF8CString("/hostapp/WTRInjectedBundle.sprx"));
  50. }
  51. void TestController::initializeTestPluginDirectory()
  52. {
  53. m_testPluginDirectory.adopt(WKStringCreateWithUTF8CString(""));
  54. }
  55. void TestController::platformInitializeContext()
  56. {
  57. }
  58. void TestController::runModal(PlatformWebView*)
  59. {
  60. }
  61. const char* TestController::platformLibraryPathForTesting()
  62. {
  63. return "/hostapp";
  64. }
  65. } // namespace WTR
  66. __attribute__((visibility("default"))) extern "C"
  67. void WTRTestControllerMainManx(int argc, const char* argv[])
  68. {
  69. WTR::TestController controller(argc, argv);
  70. }