| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file contains tests for extension loading, reloading, and | 5 // This file contains tests for extension loading, reloading, and |
| 6 // unloading behavior. | 6 // unloading behavior. |
| 7 | 7 |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Upgrade the extension. | 73 // Upgrade the extension. |
| 74 new_tab_extension = UpdateExtension( | 74 new_tab_extension = UpdateExtension( |
| 75 new_tab_extension->id(), extension_dir.Pack(), 0 /*expected upgrade*/); | 75 new_tab_extension->id(), extension_dir.Pack(), 0 /*expected upgrade*/); |
| 76 EXPECT_THAT(new_tab_extension->version()->components(), | 76 EXPECT_THAT(new_tab_extension->version()->components(), |
| 77 testing::ElementsAre(2)); | 77 testing::ElementsAre(2)); |
| 78 | 78 |
| 79 // The extension takes a couple round-trips to the renderer in order | 79 // The extension takes a couple round-trips to the renderer in order |
| 80 // to crash, so open a new tab to wait long enough. | 80 // to crash, so open a new tab to wait long enough. |
| 81 AddTabAtIndex(browser()->tab_strip_model()->count(), | 81 AddTabAtIndex(browser()->tab_strip_model()->count(), |
| 82 GURL("http://www.google.com/"), | 82 GURL("http://www.google.com/"), |
| 83 content::PAGE_TRANSITION_TYPED); | 83 ui::PAGE_TRANSITION_TYPED); |
| 84 | 84 |
| 85 // Check that the extension hasn't crashed. | 85 // Check that the extension hasn't crashed. |
| 86 ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); | 86 ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); |
| 87 EXPECT_EQ(0U, registry->terminated_extensions().size()); | 87 EXPECT_EQ(0U, registry->terminated_extensions().size()); |
| 88 EXPECT_TRUE(registry->enabled_extensions().Contains(new_tab_extension->id())); | 88 EXPECT_TRUE(registry->enabled_extensions().Contains(new_tab_extension->id())); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace | 91 } // namespace |
| 92 } // namespace extensions | 92 } // namespace extensions |
| OLD | NEW |