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

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

Issue 1506753002: [test] Test expectations in cctest should use CHECK and not DCHECK. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « test/cctest/test-utils-arm64.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 return weakmap; 53 return weakmap;
54 } 54 }
55 55
56 static int NumberOfWeakCalls = 0; 56 static int NumberOfWeakCalls = 0;
57 static void WeakPointerCallback( 57 static void WeakPointerCallback(
58 const v8::WeakCallbackData<v8::Value, void>& data) { 58 const v8::WeakCallbackData<v8::Value, void>& data) {
59 std::pair<v8::Persistent<v8::Value>*, int>* p = 59 std::pair<v8::Persistent<v8::Value>*, int>* p =
60 reinterpret_cast<std::pair<v8::Persistent<v8::Value>*, int>*>( 60 reinterpret_cast<std::pair<v8::Persistent<v8::Value>*, int>*>(
61 data.GetParameter()); 61 data.GetParameter());
62 DCHECK_EQ(1234, p->second); 62 CHECK_EQ(1234, p->second);
63 NumberOfWeakCalls++; 63 NumberOfWeakCalls++;
64 p->first->Reset(); 64 p->first->Reset();
65 } 65 }
66 66
67 67
68 TEST(Weakness) { 68 TEST(Weakness) {
69 FLAG_incremental_marking = false; 69 FLAG_incremental_marking = false;
70 LocalContext context; 70 LocalContext context;
71 Isolate* isolate = GetIsolateFrom(&context); 71 Isolate* isolate = GetIsolateFrom(&context);
72 Factory* factory = isolate->factory(); 72 Factory* factory = isolate->factory();
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 { 260 {
261 HandleScope scope(isolate); 261 HandleScope scope(isolate);
262 AllocateJSWeakMap(isolate); 262 AllocateJSWeakMap(isolate);
263 SimulateIncrementalMarking(heap); 263 SimulateIncrementalMarking(heap);
264 } 264 }
265 // The weak map is marked black here but leaving the handle scope will make 265 // The weak map is marked black here but leaving the handle scope will make
266 // the object unreachable. Aborting incremental marking will clear all the 266 // the object unreachable. Aborting incremental marking will clear all the
267 // marking bits which makes the weak map garbage. 267 // marking bits which makes the weak map garbage.
268 heap->CollectAllGarbage(); 268 heap->CollectAllGarbage();
269 } 269 }
OLDNEW
« no previous file with comments | « test/cctest/test-utils-arm64.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698