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

Side by Side Diff: extensions/browser/runtime_data_unittest.cc

Issue 207613002: Cleanup: Remove NOTIFICATION_EXTENSION_UNLOADED usage in MediaScanManager. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, add error console Created 6 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/runtime_data.cc ('k') | no next file » | 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 "extensions/browser/runtime_data.h" 5 #include "extensions/browser/runtime_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "extensions/browser/extension_registry.h" 10 #include "extensions/browser/extension_registry.h"
(...skipping 21 matching lines...) Expand all
32 DictionaryBuilder() 32 DictionaryBuilder()
33 .Set("name", "test") 33 .Set("name", "test")
34 .Set("version", "0.1") 34 .Set("version", "0.1")
35 .Set("background", DictionaryBuilder().Set("page", "bg.html"))) 35 .Set("background", DictionaryBuilder().Set("page", "bg.html")))
36 .SetID("id2") 36 .SetID("id2")
37 .Build(); 37 .Build();
38 } 38 }
39 39
40 class RuntimeDataTest : public testing::Test { 40 class RuntimeDataTest : public testing::Test {
41 public: 41 public:
42 RuntimeDataTest() : runtime_data_(&registry_) {} 42 RuntimeDataTest() : registry_(NULL), runtime_data_(&registry_) {}
43 virtual ~RuntimeDataTest() {} 43 virtual ~RuntimeDataTest() {}
44 44
45 protected: 45 protected:
46 ExtensionRegistry registry_; 46 ExtensionRegistry registry_;
47 RuntimeData runtime_data_; 47 RuntimeData runtime_data_;
48 48
49 private: 49 private:
50 DISALLOW_COPY_AND_ASSIGN(RuntimeDataTest); 50 DISALLOW_COPY_AND_ASSIGN(RuntimeDataTest);
51 }; 51 };
52 52
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 runtime_data_.SetHasUsedWebRequest(extension, false); 93 runtime_data_.SetHasUsedWebRequest(extension, false);
94 EXPECT_FALSE(runtime_data_.HasUsedWebRequest(extension)); 94 EXPECT_FALSE(runtime_data_.HasUsedWebRequest(extension));
95 } 95 }
96 96
97 // Unloading an extension stops tracking it. 97 // Unloading an extension stops tracking it.
98 TEST_F(RuntimeDataTest, OnExtensionUnloaded) { 98 TEST_F(RuntimeDataTest, OnExtensionUnloaded) {
99 scoped_refptr<Extension> extension = CreateExtensionWithBackgroundPage(); 99 scoped_refptr<Extension> extension = CreateExtensionWithBackgroundPage();
100 runtime_data_.SetBackgroundPageReady(extension, true); 100 runtime_data_.SetBackgroundPageReady(extension, true);
101 ASSERT_TRUE(runtime_data_.HasExtensionForTesting(extension)); 101 ASSERT_TRUE(runtime_data_.HasExtensionForTesting(extension));
102 102
103 runtime_data_.OnExtensionUnloaded(extension); 103 runtime_data_.OnExtensionUnloaded(NULL, extension);
104 EXPECT_FALSE(runtime_data_.HasExtensionForTesting(extension)); 104 EXPECT_FALSE(runtime_data_.HasExtensionForTesting(extension));
105 } 105 }
106 106
107 } // namespace 107 } // namespace
108 } // namespace extensions 108 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/runtime_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698