| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 std::string query = BuildQuery("", test_case); | 148 std::string query = BuildQuery("", test_case); |
| 149 replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size())); | 149 replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size())); |
| 150 return test_url.ReplaceComponents(replacements); | 150 return test_url.ReplaceComponents(replacements); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void RunTest(const std::string& test_case) { | 153 void RunTest(const std::string& test_case) { |
| 154 GURL url = GetTestFileUrl(test_case); | 154 GURL url = GetTestFileUrl(test_case); |
| 155 RunTestURL(url); | 155 RunTestURL(url); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // Run the test and reload. This can test for clean shutdown, including leaked |
| 159 // instance object vars. |
| 160 void RunTestAndReload(const std::string& test_case) { |
| 161 GURL url = GetTestFileUrl(test_case); |
| 162 RunTestURL(url); |
| 163 // If that passed, we simply run the test again, which navigates again. |
| 164 RunTestURL(url); |
| 165 } |
| 166 |
| 158 void RunTestViaHTTP(const std::string& test_case) { | 167 void RunTestViaHTTP(const std::string& test_case) { |
| 159 // For HTTP tests, we use the output DIR to grab the generated files such | 168 // For HTTP tests, we use the output DIR to grab the generated files such |
| 160 // as the NEXEs. | 169 // as the NEXEs. |
| 161 FilePath exe_dir = CommandLine::ForCurrentProcess()->GetProgram().DirName(); | 170 FilePath exe_dir = CommandLine::ForCurrentProcess()->GetProgram().DirName(); |
| 162 FilePath src_dir; | 171 FilePath src_dir; |
| 163 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); | 172 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); |
| 164 | 173 |
| 165 // TestServer expects a path relative to source. So we must first | 174 // TestServer expects a path relative to source. So we must first |
| 166 // generate absolute paths to SRC and EXE and from there generate | 175 // generate absolute paths to SRC and EXE and from there generate |
| 167 // a relative path. | 176 // a relative path. |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 #define MAYBE_InputEvent DISABLED_InputEvent | 444 #define MAYBE_InputEvent DISABLED_InputEvent |
| 436 #else | 445 #else |
| 437 #define MAYBE_InputEvent InputEvent | 446 #define MAYBE_InputEvent InputEvent |
| 438 #endif | 447 #endif |
| 439 | 448 |
| 440 TEST_PPAPI_IN_PROCESS(MAYBE_InputEvent) | 449 TEST_PPAPI_IN_PROCESS(MAYBE_InputEvent) |
| 441 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_InputEvent) | 450 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_InputEvent) |
| 442 // TODO(bbudge) Enable when input events are proxied correctly for NaCl. | 451 // TODO(bbudge) Enable when input events are proxied correctly for NaCl. |
| 443 TEST_PPAPI_NACL_VIA_HTTP(DISABLED_InputEvent) | 452 TEST_PPAPI_NACL_VIA_HTTP(DISABLED_InputEvent) |
| 444 | 453 |
| 445 TEST_PPAPI_IN_PROCESS(Instance) | 454 TEST_PPAPI_IN_PROCESS(Instance_ExecuteScript); |
| 446 TEST_PPAPI_OUT_OF_PROCESS(Instance) | 455 TEST_PPAPI_OUT_OF_PROCESS(Instance_ExecuteScript) |
| 447 // The Instance test is actually InstanceDeprecated which isn't supported | 456 // ExecuteScript isn't supported by NaCl. |
| 448 // by NaCl. | 457 |
| 458 // We run and reload the RecursiveObjects test to ensure that the InstanceObject |
| 459 // (and others) are properly cleaned up after the first run. |
| 460 IN_PROC_BROWSER_TEST_F(PPAPITest, Instance_RecursiveObjects) { |
| 461 RunTestAndReload("Instance_RecursiveObjects"); |
| 462 } |
| 463 // TODO(dmichael): Make it work out-of-process (or at least see whether we |
| 464 // care). |
| 465 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, |
| 466 DISABLED_Instance_RecursiveObjects) { |
| 467 RunTestAndReload("Instance_RecursiveObjects"); |
| 468 } |
| 469 TEST_PPAPI_IN_PROCESS(Instance_TestLeakedObjectDestructors); |
| 470 TEST_PPAPI_OUT_OF_PROCESS(Instance_TestLeakedObjectDestructors); |
| 471 // ScriptableObjects aren't supported in NaCl, so Instance_RecursiveObjects and |
| 472 // Instance_TestLeakedObjectDestructors don't make sense for NaCl. |
| 449 | 473 |
| 450 TEST_PPAPI_IN_PROCESS(Graphics2D) | 474 TEST_PPAPI_IN_PROCESS(Graphics2D) |
| 451 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D) | 475 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D) |
| 452 TEST_PPAPI_NACL_VIA_HTTP(Graphics2D) | 476 TEST_PPAPI_NACL_VIA_HTTP(Graphics2D) |
| 453 | 477 |
| 454 TEST_PPAPI_IN_PROCESS(ImageData) | 478 TEST_PPAPI_IN_PROCESS(ImageData) |
| 455 TEST_PPAPI_OUT_OF_PROCESS(ImageData) | 479 TEST_PPAPI_OUT_OF_PROCESS(ImageData) |
| 456 TEST_PPAPI_NACL_VIA_HTTP(ImageData) | 480 TEST_PPAPI_NACL_VIA_HTTP(ImageData) |
| 457 | 481 |
| 458 TEST_PPAPI_IN_PROCESS(BrowserFont) | 482 TEST_PPAPI_IN_PROCESS(BrowserFont) |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) | 983 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) |
| 960 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) | 984 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) |
| 961 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) | 985 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) |
| 962 | 986 |
| 963 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) | 987 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) |
| 964 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) | 988 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) |
| 965 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) | 989 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) |
| 966 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) | 990 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) |
| 967 | 991 |
| 968 #endif // ADDRESS_SANITIZER | 992 #endif // ADDRESS_SANITIZER |
| OLD | NEW |