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

Side by Side Diff: extensions/browser/api/api_resource_manager_unittest.cc

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | extensions/browser/api/app_current_window_internal/app_current_window_internal_api.h » ('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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/test/test_browser_thread_bundle.h" 8 #include "content/public/test/test_browser_thread_bundle.h"
9 #include "extensions/browser/api/api_resource.h" 9 #include "extensions/browser/api/api_resource.h"
10 #include "extensions/browser/api/api_resource_manager.h" 10 #include "extensions/browser/api/api_resource_manager.h"
(...skipping 15 matching lines...) Expand all
26 26
27 private: 27 private:
28 content::TestBrowserThreadBundle thread_bundle_; 28 content::TestBrowserThreadBundle thread_bundle_;
29 scoped_ptr<NotificationService> notification_service_; 29 scoped_ptr<NotificationService> notification_service_;
30 }; 30 };
31 31
32 class FakeApiResource : public ApiResource { 32 class FakeApiResource : public ApiResource {
33 public: 33 public:
34 explicit FakeApiResource(const std::string& owner_extension_id) 34 explicit FakeApiResource(const std::string& owner_extension_id)
35 : ApiResource(owner_extension_id) {} 35 : ApiResource(owner_extension_id) {}
36 virtual ~FakeApiResource() {} 36 ~FakeApiResource() override {}
37 static const BrowserThread::ID kThreadId = BrowserThread::UI; 37 static const BrowserThread::ID kThreadId = BrowserThread::UI;
38 }; 38 };
39 39
40 TEST_F(ApiResourceManagerUnitTest, TwoAppsCannotShareResources) { 40 TEST_F(ApiResourceManagerUnitTest, TwoAppsCannotShareResources) {
41 scoped_ptr<ApiResourceManager<FakeApiResource> > manager( 41 scoped_ptr<ApiResourceManager<FakeApiResource> > manager(
42 new ApiResourceManager<FakeApiResource>(NULL)); 42 new ApiResourceManager<FakeApiResource>(NULL));
43 scoped_refptr<extensions::Extension> extension_one = 43 scoped_refptr<extensions::Extension> extension_one =
44 test_util::CreateEmptyExtension("one"); 44 test_util::CreateEmptyExtension("one");
45 scoped_refptr<extensions::Extension> extension_two = 45 scoped_refptr<extensions::Extension> extension_two =
46 test_util::CreateEmptyExtension("two"); 46 test_util::CreateEmptyExtension("two");
(...skipping 12 matching lines...) Expand all
59 59
60 // Confirm neither extension can get the other's resource. 60 // Confirm neither extension can get the other's resource.
61 ASSERT_TRUE(manager->Get(extension_one_id, resource_two_id) == NULL); 61 ASSERT_TRUE(manager->Get(extension_one_id, resource_two_id) == NULL);
62 ASSERT_TRUE(manager->Get(extension_two_id, resource_one_id) == NULL); 62 ASSERT_TRUE(manager->Get(extension_two_id, resource_one_id) == NULL);
63 63
64 // And make sure we're not susceptible to any Jedi mind tricks. 64 // And make sure we're not susceptible to any Jedi mind tricks.
65 ASSERT_TRUE(manager->Get(std::string(), resource_one_id) == NULL); 65 ASSERT_TRUE(manager->Get(std::string(), resource_one_id) == NULL);
66 } 66 }
67 67
68 } // namespace extensions 68 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/app_current_window_internal/app_current_window_internal_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698