Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: test/cctest/test-api.cc

Issue 1269583002: Fix idle notification for background tab. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: deflake TestIdleNotification by ensuring that sweeping is completed. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 15416 matching lines...) Expand 10 before | Expand all | Expand 10 after
15427 CHECK_GT(size_with_garbage, initial_size + MB); 15427 CHECK_GT(size_with_garbage, initial_size + MB);
15428 bool finished = false; 15428 bool finished = false;
15429 for (int i = 0; i < 200 && !finished; i++) { 15429 for (int i = 0; i < 200 && !finished; i++) {
15430 if (i < 10 && CcTest::heap()->incremental_marking()->IsStopped()) { 15430 if (i < 10 && CcTest::heap()->incremental_marking()->IsStopped()) {
15431 CcTest::heap()->StartIdleIncrementalMarking(); 15431 CcTest::heap()->StartIdleIncrementalMarking();
15432 } 15432 }
15433 finished = env->GetIsolate()->IdleNotificationDeadline( 15433 finished = env->GetIsolate()->IdleNotificationDeadline(
15434 (v8::base::TimeTicks::HighResolutionNow().ToInternalValue() / 15434 (v8::base::TimeTicks::HighResolutionNow().ToInternalValue() /
15435 static_cast<double>(v8::base::Time::kMicrosecondsPerSecond)) + 15435 static_cast<double>(v8::base::Time::kMicrosecondsPerSecond)) +
15436 IdlePauseInSeconds); 15436 IdlePauseInSeconds);
15437 if (CcTest::heap()->mark_compact_collector()->sweeping_in_progress()) {
15438 CcTest::heap()->mark_compact_collector()->EnsureSweepingCompleted();
15439 }
15437 } 15440 }
15438 intptr_t final_size = CcTest::heap()->SizeOfObjects(); 15441 intptr_t final_size = CcTest::heap()->SizeOfObjects();
15439 CHECK(finished); 15442 CHECK(finished);
15440 CHECK_LT(final_size, initial_size + 1); 15443 CHECK_LT(final_size, initial_size + 1);
15441 } 15444 }
15442 15445
15443 15446
15444 TEST(Regress2333) { 15447 TEST(Regress2333) {
15445 LocalContext env; 15448 LocalContext env;
15446 for (int i = 0; i < 3; i++) { 15449 for (int i = 0; i < 3; i++) {
(...skipping 6480 matching lines...) Expand 10 before | Expand all | Expand 10 after
21927 21930
21928 v8::TryCatch try_catch(CcTest::isolate()); 21931 v8::TryCatch try_catch(CcTest::isolate());
21929 timeout_thread.Start(); 21932 timeout_thread.Start();
21930 21933
21931 CompileRun( 21934 CompileRun(
21932 "var ab = new SharedArrayBuffer(4);" 21935 "var ab = new SharedArrayBuffer(4);"
21933 "var i32a = new Int32Array(ab);" 21936 "var i32a = new Int32Array(ab);"
21934 "Atomics.futexWait(i32a, 0, 0);"); 21937 "Atomics.futexWait(i32a, 0, 0);");
21935 CHECK(try_catch.HasTerminated()); 21938 CHECK(try_catch.HasTerminated());
21936 } 21939 }
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698