| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Run all of our test shell tests. This is just an entry point | 5 // Run all of our test shell tests. This is just an entry point |
| 6 // to kick off gTest's RUN_ALL_TESTS(). | 6 // to kick off gTest's RUN_ALL_TESTS(). |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "webkit/tools/test_shell/test_shell_webkit_init.h" | 25 #include "webkit/tools/test_shell/test_shell_webkit_init.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 27 |
| 28 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 29 #include "base/mac/bundle_locations.h" | 29 #include "base/mac/bundle_locations.h" |
| 30 #include "base/mac/mac_util.h" | 30 #include "base/mac/mac_util.h" |
| 31 #include "base/mac/scoped_nsautorelease_pool.h" | 31 #include "base/mac/scoped_nsautorelease_pool.h" |
| 32 #include "base/path_service.h" | 32 #include "base/path_service.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 const char* const TestShellTest::kJavascriptDelayExitScript = | |
| 36 "<script>" | |
| 37 "window.layoutTestController.waitUntilDone();" | |
| 38 "window.addEventListener('load', function() {" | |
| 39 " var x = document.body.clientWidth;" // Force a document layout | |
| 40 " window.layoutTestController.notifyDone();" | |
| 41 "});" | |
| 42 "</script>"; | |
| 43 | |
| 44 class TestShellTestSuite : public base::TestSuite { | 35 class TestShellTestSuite : public base::TestSuite { |
| 45 public: | 36 public: |
| 46 TestShellTestSuite(int argc, char** argv) | 37 TestShellTestSuite(int argc, char** argv) |
| 47 : base::TestSuite(argc, argv), | 38 : base::TestSuite(argc, argv), |
| 48 platform_delegate_(*CommandLine::ForCurrentProcess()), | 39 platform_delegate_(*CommandLine::ForCurrentProcess()), |
| 49 test_shell_webkit_init_(true) { | 40 test_shell_webkit_init_(true) { |
| 50 } | 41 } |
| 51 | 42 |
| 52 virtual void Initialize() { | 43 virtual void Initialize() { |
| 53 // Override DIR_EXE early in case anything in base::TestSuite uses it. | 44 // Override DIR_EXE early in case anything in base::TestSuite uses it. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 }; | 98 }; |
| 108 | 99 |
| 109 int main(int argc, char** argv) { | 100 int main(int argc, char** argv) { |
| 110 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
| 111 base::mac::ScopedNSAutoreleasePool scoped_pool; | 102 base::mac::ScopedNSAutoreleasePool scoped_pool; |
| 112 #endif | 103 #endif |
| 113 | 104 |
| 114 TestShellPlatformDelegate::PreflightArgs(&argc, &argv); | 105 TestShellPlatformDelegate::PreflightArgs(&argc, &argv); |
| 115 return TestShellTestSuite(argc, argv).Run(); | 106 return TestShellTestSuite(argc, argv).Run(); |
| 116 } | 107 } |
| OLD | NEW |