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

Side by Side Diff: chrome/browser/extensions/events_apitest.cc

Issue 1227093008: Clear an extension's filtered events when a context is destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 5 years, 5 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 | « no previous file | chrome/common/extensions/value_counter_unittest.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "extensions/browser/event_router.h" 8 #include "extensions/browser/event_router.h"
9 #include "extensions/browser/extension_registry.h" 9 #include "extensions/browser/extension_registry.h"
10 10
(...skipping 27 matching lines...) Expand all
38 test_data_dir_.AppendASCII(test_extension_name); 38 test_data_dir_.AppendASCII(test_extension_name);
39 const Extension* extension = 39 const Extension* extension =
40 GetExtensionByPath(registry->enabled_extensions(), extension_path); 40 GetExtensionByPath(registry->enabled_extensions(), extension_path);
41 ASSERT_TRUE(extension) << "No extension found at \"" << extension_path.value() 41 ASSERT_TRUE(extension) << "No extension found at \"" << extension_path.value()
42 << "\" (absolute path \"" 42 << "\" (absolute path \""
43 << base::MakeAbsoluteFilePath(extension_path).value() 43 << base::MakeAbsoluteFilePath(extension_path).value()
44 << "\")"; 44 << "\")";
45 const std::string& id = extension->id(); 45 const std::string& id = extension->id();
46 46
47 // The page has closed, so no matter what all events are no longer listened 47 // The page has closed, so no matter what all events are no longer listened
48 // to. 48 // to. Assertions for normal events:
49 EXPECT_FALSE( 49 EXPECT_FALSE(
50 event_router->ExtensionHasEventListener(id, "browserAction.onClicked")); 50 event_router->ExtensionHasEventListener(id, "browserAction.onClicked"));
51 EXPECT_FALSE( 51 EXPECT_FALSE(
52 event_router->ExtensionHasEventListener(id, "runtime.onStartup")); 52 event_router->ExtensionHasEventListener(id, "runtime.onStartup"));
53 EXPECT_FALSE( 53 EXPECT_FALSE(
54 event_router->ExtensionHasEventListener(id, "runtime.onSuspend")); 54 event_router->ExtensionHasEventListener(id, "runtime.onSuspend"));
55 EXPECT_FALSE( 55 EXPECT_FALSE(
56 event_router->ExtensionHasEventListener(id, "runtime.onInstalled")); 56 event_router->ExtensionHasEventListener(id, "runtime.onInstalled"));
57 // Assertions for filtered events:
58 EXPECT_FALSE(event_router->ExtensionHasEventListener(
59 id, "webNavigation.onBeforeNavigate"));
60 EXPECT_FALSE(
61 event_router->ExtensionHasEventListener(id, "webNavigation.onCommitted"));
62 EXPECT_FALSE(event_router->ExtensionHasEventListener(
63 id, "webNavigation.onDOMContentLoaded"));
64 EXPECT_FALSE(
65 event_router->ExtensionHasEventListener(id, "webNavigation.onCompleted"));
57 } 66 }
58 67
59 } // namespace extensions 68 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/value_counter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698