| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 int result = testSuite->Run(); | 50 int result = testSuite->Run(); |
| 51 | 51 |
| 52 // Tickle EndOfTaskRunner which among other things will flush the queue | 52 // Tickle EndOfTaskRunner which among other things will flush the queue |
| 53 // of error messages via V8Initializer::reportRejectedPromisesOnMainThread. | 53 // of error messages via V8Initializer::reportRejectedPromisesOnMainThread. |
| 54 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothin
g)); | 54 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&base::DoNothin
g)); |
| 55 base::RunLoop().RunUntilIdle(); | 55 base::RunLoop().RunUntilIdle(); |
| 56 | 56 |
| 57 // Collect garbage (including threadspecific persistent handles) in order | 57 // Collect garbage (including threadspecific persistent handles) in order |
| 58 // to release mock objects referred from v8 or Oilpan heap. Otherwise false | 58 // to release mock objects referred from v8 or Oilpan heap. Otherwise false |
| 59 // mock leaks will be reported. | 59 // mock leaks will be reported. |
| 60 blink::ThreadState::current()->callThreadShutdownHooks(); | |
| 61 blink::V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurrent()
); | 60 blink::V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurrent()
); |
| 62 | 61 |
| 63 content::TearDownBlinkTestEnvironment(); | 62 content::TearDownBlinkTestEnvironment(); |
| 64 | 63 |
| 65 return result; | 64 return result; |
| 66 } | 65 } |
| 67 | 66 |
| 68 } // namespace | 67 } // namespace |
| 69 | 68 |
| 70 int main(int argc, char** argv) | 69 int main(int argc, char** argv) |
| 71 { | 70 { |
| 72 mojo::edk::Init(); | 71 mojo::edk::Init(); |
| 73 | 72 |
| 74 base::TestSuite testSuite(argc, argv); | 73 base::TestSuite testSuite(argc, argv); |
| 75 return base::LaunchUnitTests(argc, argv, base::Bind(&runHelper, base::Unreta
ined(&testSuite))); | 74 return base::LaunchUnitTests(argc, argv, base::Bind(&runHelper, base::Unreta
ined(&testSuite))); |
| 76 } | 75 } |
| OLD | NEW |