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

Side by Side Diff: test/cctest/test-object-observe.cc

Issue 16337005: Deprecate FACTORY helper macro. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-mark-compact.cc ('k') | test/cctest/test-parsing.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 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 TEST(ObservationWeakMap) { 412 TEST(ObservationWeakMap) {
413 HarmonyIsolate isolate; 413 HarmonyIsolate isolate;
414 HandleScope scope(isolate.GetIsolate()); 414 HandleScope scope(isolate.GetIsolate());
415 v8::LocalContext context; 415 v8::LocalContext context;
416 CompileRun( 416 CompileRun(
417 "var obj = {};" 417 "var obj = {};"
418 "Object.observe(obj, function(){});" 418 "Object.observe(obj, function(){});"
419 "Object.getNotifier(obj);" 419 "Object.getNotifier(obj);"
420 "obj = null;"); 420 "obj = null;");
421 i::Handle<i::JSObject> observation_state = FACTORY->observation_state(); 421 i::Handle<i::JSObject> observation_state =
422 i::Isolate::Current()->factory()->observation_state();
422 i::Handle<i::JSWeakMap> observerInfoMap = 423 i::Handle<i::JSWeakMap> observerInfoMap =
423 i::Handle<i::JSWeakMap>::cast( 424 i::Handle<i::JSWeakMap>::cast(
424 i::GetProperty(observation_state, "observerInfoMap")); 425 i::GetProperty(observation_state, "observerInfoMap"));
425 i::Handle<i::JSWeakMap> objectInfoMap = 426 i::Handle<i::JSWeakMap> objectInfoMap =
426 i::Handle<i::JSWeakMap>::cast( 427 i::Handle<i::JSWeakMap>::cast(
427 i::GetProperty(observation_state, "objectInfoMap")); 428 i::GetProperty(observation_state, "objectInfoMap"));
428 i::Handle<i::JSWeakMap> notifierTargetMap = 429 i::Handle<i::JSWeakMap> notifierTargetMap =
429 i::Handle<i::JSWeakMap>::cast( 430 i::Handle<i::JSWeakMap>::cast(
430 i::GetProperty(observation_state, "notifierTargetMap")); 431 i::GetProperty(observation_state, "notifierTargetMap"));
431 CHECK_EQ(1, NumberOfElements(observerInfoMap)); 432 CHECK_EQ(1, NumberOfElements(observerInfoMap));
432 CHECK_EQ(1, NumberOfElements(objectInfoMap)); 433 CHECK_EQ(1, NumberOfElements(objectInfoMap));
433 CHECK_EQ(1, NumberOfElements(notifierTargetMap)); 434 CHECK_EQ(1, NumberOfElements(notifierTargetMap));
434 HEAP->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask); 435 HEAP->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask);
435 CHECK_EQ(0, NumberOfElements(observerInfoMap)); 436 CHECK_EQ(0, NumberOfElements(observerInfoMap));
436 CHECK_EQ(0, NumberOfElements(objectInfoMap)); 437 CHECK_EQ(0, NumberOfElements(objectInfoMap));
437 CHECK_EQ(0, NumberOfElements(notifierTargetMap)); 438 CHECK_EQ(0, NumberOfElements(notifierTargetMap));
438 } 439 }
OLDNEW
« no previous file with comments | « test/cctest/test-mark-compact.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698