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

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

Issue 264793015: Fix ObjectNotifierPerformChange leak after r21126 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tighten acceptList argument type requirements, remove fuzz-natives blacklist Created 6 years, 7 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 | « src/runtime.cc ('k') | test/mjsunit/fuzz-natives-part2.js » ('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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 } 685 }
686 686
687 687
688 TEST(DontLeakContextOnNotifierPerformChange) { 688 TEST(DontLeakContextOnNotifierPerformChange) {
689 HandleScope scope(CcTest::isolate()); 689 HandleScope scope(CcTest::isolate());
690 Handle<Value> foo = String::NewFromUtf8(CcTest::isolate(), "foo"); 690 Handle<Value> foo = String::NewFromUtf8(CcTest::isolate(), "foo");
691 LocalContext context(CcTest::isolate()); 691 LocalContext context(CcTest::isolate());
692 context->SetSecurityToken(foo); 692 context->SetSecurityToken(foo);
693 CompileRun("var obj = {};"); 693 CompileRun("var obj = {};");
694 Handle<Value> object = CompileRun("obj"); 694 Handle<Value> object = CompileRun("obj");
695 Handle<Value> notifier = CompileRun("Object.getNotifier(obj)");
695 { 696 {
696 HandleScope scope(CcTest::isolate()); 697 HandleScope scope(CcTest::isolate());
697 LocalContext context2(CcTest::isolate()); 698 LocalContext context2(CcTest::isolate());
698 context2->SetSecurityToken(foo); 699 context2->SetSecurityToken(foo);
699 context2->Global()->Set(String::NewFromUtf8(CcTest::isolate(), "obj"), 700 context2->Global()->Set(String::NewFromUtf8(CcTest::isolate(), "obj"),
700 object); 701 object);
701 CompileRun("var n = Object.getNotifier(obj);" 702 context2->Global()->Set(String::NewFromUtf8(CcTest::isolate(), "notifier"),
702 "n.performChange('foo', function() {});"); 703 notifier);
704 CompileRun("var obj2 = {};"
705 "var notifier2 = Object.getNotifier(obj2);"
706 "notifier2.performChange.call("
707 "notifier, 'foo', function(){})");
703 } 708 }
704 709
705 v8::V8::ContextDisposedNotification(); 710 v8::V8::ContextDisposedNotification();
706 CheckSurvivingGlobalObjectsCount(1); 711 CheckSurvivingGlobalObjectsCount(1);
707 } 712 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/fuzz-natives-part2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698