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 "content/public/test/test_launcher.h" | 5 #include "content/public/test/test_launcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 "--gtest_filter=<your_test_name> flag along with either\n" | 537 "--gtest_filter=<your_test_name> flag along with either\n" |
538 "--single_process (to run the test in one launcher/browser process) or\n" | 538 "--single_process (to run the test in one launcher/browser process) or\n" |
539 "--single-process (to do the above, and also run Chrome in single-" | 539 "--single-process (to do the above, and also run Chrome in single-" |
540 "process mode).\n"); | 540 "process mode).\n"); |
541 | 541 |
542 base::MessageLoopForIO message_loop; | 542 base::MessageLoopForIO message_loop; |
543 #if defined(OS_POSIX) | 543 #if defined(OS_POSIX) |
544 base::FileDescriptorWatcher file_descriptor_watcher(&message_loop); | 544 base::FileDescriptorWatcher file_descriptor_watcher(&message_loop); |
545 #endif | 545 #endif |
546 | 546 |
| 547 launcher_delegate->PreSharding(); |
| 548 |
547 // Allow the |launcher_delegate| to modify |default_jobs|. | 549 // Allow the |launcher_delegate| to modify |default_jobs|. |
548 launcher_delegate->AdjustDefaultParallelJobs(&default_jobs); | 550 launcher_delegate->AdjustDefaultParallelJobs(&default_jobs); |
549 | 551 |
550 WrapperTestLauncherDelegate delegate(launcher_delegate); | 552 WrapperTestLauncherDelegate delegate(launcher_delegate); |
551 base::TestLauncher launcher(&delegate, default_jobs); | 553 base::TestLauncher launcher(&delegate, default_jobs); |
552 const int result = launcher.Run() ? 0 : 1; | 554 const int result = launcher.Run() ? 0 : 1; |
553 launcher_delegate->OnDoneRunningTests(); | 555 launcher_delegate->OnDoneRunningTests(); |
554 return result; | 556 return result; |
555 } | 557 } |
556 | 558 |
557 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 559 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
558 return g_launcher_delegate; | 560 return g_launcher_delegate; |
559 } | 561 } |
560 | 562 |
561 ContentMainParams* GetContentMainParams() { | 563 ContentMainParams* GetContentMainParams() { |
562 return g_params; | 564 return g_params; |
563 } | 565 } |
564 | 566 |
565 } // namespace content | 567 } // namespace content |
OLD | NEW |