| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" |
| 8 #include "extensions/common/extension.h" | 9 #include "extensions/common/extension.h" |
| 9 #include "extensions/common/extension_set.h" | 10 #include "extensions/common/extension_set.h" |
| 10 #include "extensions/common/features/feature.h" | 11 #include "extensions/common/features/feature.h" |
| 11 #include "extensions/renderer/scoped_web_frame.h" | 12 #include "extensions/renderer/scoped_web_frame.h" |
| 12 #include "extensions/renderer/script_context.h" | 13 #include "extensions/renderer/script_context.h" |
| 13 #include "extensions/renderer/script_context_set.h" | 14 #include "extensions/renderer/script_context_set.h" |
| 14 #include "gin/public/context_holder.h" | 15 #include "gin/public/context_holder.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/WebKit/public/web/WebFrame.h" | 17 #include "third_party/WebKit/public/web/WebFrame.h" |
| 17 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 50 |
| 50 // Test context is correctly removed. | 51 // Test context is correctly removed. |
| 51 context_set.Remove(context); | 52 context_set.Remove(context); |
| 52 EXPECT_EQ(0u, context_set.size()); | 53 EXPECT_EQ(0u, context_set.size()); |
| 53 EXPECT_EQ(nullptr, context_set.GetByV8Context(v8_context)); | 54 EXPECT_EQ(nullptr, context_set.GetByV8Context(v8_context)); |
| 54 | 55 |
| 55 // After removal, the context should be marked for destruction. | 56 // After removal, the context should be marked for destruction. |
| 56 EXPECT_FALSE(context->is_valid()); | 57 EXPECT_FALSE(context->is_valid()); |
| 57 | 58 |
| 58 // Run loop to do the actual deletion. | 59 // Run loop to do the actual deletion. |
| 59 loop.RunUntilIdle(); | 60 base::RunLoop().RunUntilIdle(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 } // namespace extensions | 63 } // namespace extensions |
| OLD | NEW |