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

Side by Side Diff: extensions/renderer/script_context_set_unittest.cc

Issue 1074273002: Move the event attach/detach logic on unload from event.js to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: being process of relanding - more test assertions Created 5 years, 8 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 | « extensions/renderer/script_context.cc ('k') | extensions/renderer/v8_schema_registry.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "extensions/common/extension.h" 6 #include "extensions/common/extension.h"
7 #include "extensions/common/features/feature.h" 7 #include "extensions/common/features/feature.h"
8 #include "extensions/renderer/script_context.h" 8 #include "extensions/renderer/script_context.h"
9 #include "extensions/renderer/script_context_set.h" 9 #include "extensions/renderer/script_context_set.h"
10 #include "gin/public/context_holder.h" 10 #include "gin/public/context_holder.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // GetAll() returns a copy so removing from one should not remove from others. 46 // GetAll() returns a copy so removing from one should not remove from others.
47 ScriptContextSet::ContextSet set_copy = context_set.GetAll(); 47 ScriptContextSet::ContextSet set_copy = context_set.GetAll();
48 EXPECT_EQ(1u, set_copy.count(context)); 48 EXPECT_EQ(1u, set_copy.count(context));
49 49
50 context_set.Remove(context); 50 context_set.Remove(context);
51 EXPECT_EQ(0, context_set.size()); 51 EXPECT_EQ(0, context_set.size());
52 EXPECT_FALSE(context_set.GetByV8Context(context->v8_context())); 52 EXPECT_FALSE(context_set.GetByV8Context(context->v8_context()));
53 EXPECT_EQ(1u, set_copy.size()); 53 EXPECT_EQ(1u, set_copy.size());
54 54
55 // After removal, the context should be marked for destruction. 55 // After removal, the context should be marked for destruction.
56 EXPECT_FALSE(context->web_frame()); 56 EXPECT_FALSE(context->is_valid());
57 57
58 // Run loop to do the actual deletion. 58 // Run loop to do the actual deletion.
59 loop.RunUntilIdle(); 59 loop.RunUntilIdle();
60 } 60 }
61 61
62 } // namespace extensions 62 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | extensions/renderer/v8_schema_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698