| 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 14 matching lines...) Expand all Loading... |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // Check the fix for http://crbug.com/178542. | 27 // Check the fix for http://crbug.com/178542. |
| 28 IN_PROC_BROWSER_TEST_F(ExtensionLoadingTest, | 28 IN_PROC_BROWSER_TEST_F(ExtensionLoadingTest, |
| 29 UpgradeAfterNavigatingFromOverriddenNewTabPage) { | 29 UpgradeAfterNavigatingFromOverriddenNewTabPage) { |
| 30 embedded_test_server()->ServeFilesFromDirectory( | 30 embedded_test_server()->ServeFilesFromDirectory( |
| 31 base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | 31 base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| 32 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 32 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 33 | 33 |
| 34 TestExtensionDir extension_dir; | 34 TestExtensionDir extension_dir; |
| 35 const char* manifest_template = | 35 const char manifest_template[] = |
| 36 "{" | 36 "{" |
| 37 " \"name\": \"Overrides New Tab\"," | 37 " \"name\": \"Overrides New Tab\"," |
| 38 " \"version\": \"%d\"," | 38 " \"version\": \"%d\"," |
| 39 " \"description\": \"Overrides New Tab\"," | 39 " \"description\": \"Overrides New Tab\"," |
| 40 " \"manifest_version\": 2," | 40 " \"manifest_version\": 2," |
| 41 " \"background\": {" | 41 " \"background\": {" |
| 42 " \"persistent\": false," | 42 " \"persistent\": false," |
| 43 " \"scripts\": [\"event.js\"]" | 43 " \"scripts\": [\"event.js\"]" |
| 44 " }," | 44 " }," |
| 45 " \"chrome_url_overrides\": {" | 45 " \"chrome_url_overrides\": {" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 ui::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 |