| 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 "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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 // Unloading an extension erases any data that shouldn't explicitly be kept | 77 // Unloading an extension erases any data that shouldn't explicitly be kept |
| 78 // across loads. | 78 // across loads. |
| 79 TEST_F(RuntimeDataTest, OnExtensionUnloaded) { | 79 TEST_F(RuntimeDataTest, OnExtensionUnloaded) { |
| 80 scoped_refptr<Extension> extension = CreateExtensionWithBackgroundPage(); | 80 scoped_refptr<Extension> extension = CreateExtensionWithBackgroundPage(); |
| 81 runtime_data_.SetBackgroundPageReady(extension->id(), true); | 81 runtime_data_.SetBackgroundPageReady(extension->id(), true); |
| 82 ASSERT_TRUE(runtime_data_.HasExtensionForTesting(extension->id())); | 82 ASSERT_TRUE(runtime_data_.HasExtensionForTesting(extension->id())); |
| 83 runtime_data_.SetBeingUpgraded(extension->id(), true); | 83 runtime_data_.SetBeingUpgraded(extension->id(), true); |
| 84 | 84 |
| 85 runtime_data_.OnExtensionUnloaded( | 85 runtime_data_.OnExtensionUnloaded(NULL, extension.get(), |
| 86 NULL, extension.get(), UnloadedExtensionInfo::REASON_DISABLE); | 86 UnloadedExtensionReason::REASON_DISABLE); |
| 87 EXPECT_TRUE(runtime_data_.HasExtensionForTesting(extension->id())); | 87 EXPECT_TRUE(runtime_data_.HasExtensionForTesting(extension->id())); |
| 88 EXPECT_FALSE(runtime_data_.IsBackgroundPageReady(extension.get())); | 88 EXPECT_FALSE(runtime_data_.IsBackgroundPageReady(extension.get())); |
| 89 EXPECT_TRUE(runtime_data_.IsBeingUpgraded(extension->id())); | 89 EXPECT_TRUE(runtime_data_.IsBeingUpgraded(extension->id())); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| 93 } // namespace extensions | 93 } // namespace extensions |
| OLD | NEW |