OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
8 #include "chrome/browser/extensions/test_extension_dir.h" | 8 #include "chrome/browser/extensions/test_extension_dir.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 extension_dir.WriteFile( | 71 extension_dir.WriteFile( |
72 FILE_PATH_LITERAL("options.js"), | 72 FILE_PATH_LITERAL("options.js"), |
73 "chrome.tabs.getCurrent(function(tab) {\n" | 73 "chrome.tabs.getCurrent(function(tab) {\n" |
74 " chrome.test.sendMessage(tab ? 'tab' : 'embedded');\n" | 74 " chrome.test.sendMessage(tab ? 'tab' : 'embedded');\n" |
75 "});\n"); | 75 "});\n"); |
76 extension_dir.WriteManifest( | 76 extension_dir.WriteManifest( |
77 DictionaryBuilder() | 77 DictionaryBuilder() |
78 .Set("manifest_version", 2) | 78 .Set("manifest_version", 2) |
79 .Set("name", "Extension for options param test") | 79 .Set("name", "Extension for options param test") |
80 .Set("options_ui", | 80 .Set("options_ui", |
81 std::move(DictionaryBuilder().Set("page", "options.html"))) | 81 DictionaryBuilder().Set("page", "options.html").Build()) |
82 .Set("version", "1") | 82 .Set("version", "1") |
83 .ToJSON()); | 83 .ToJSON()); |
84 | 84 |
85 ExtensionTestMessageListener listener(false /* will_reply */); | 85 ExtensionTestMessageListener listener(false /* will_reply */); |
86 scoped_refptr<const Extension> extension = | 86 scoped_refptr<const Extension> extension = |
87 InstallExtension(extension_dir.Pack(), 1); | 87 InstallExtension(extension_dir.Pack(), 1); |
88 ASSERT_TRUE(extension.get()); | 88 ASSERT_TRUE(extension.get()); |
89 ui_test_utils::NavigateToURL( | 89 ui_test_utils::NavigateToURL( |
90 browser(), GURL("chrome://extensions?options=" + extension->id())); | 90 browser(), GURL("chrome://extensions?options=" + extension->id())); |
91 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 91 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
92 ASSERT_EQ("embedded", listener.message()); | 92 ASSERT_EQ("embedded", listener.message()); |
93 } | 93 } |
94 | 94 |
95 } // namespace extensions | 95 } // namespace extensions |
OLD | NEW |