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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_test.cc

Issue 1015123003: Extension window.create API accepts state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minimize(), Maximize() after Show() Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tabs/tabs_test.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc
index 38309a6a13404ec1b909ac5565e8a24fb4b30bcc..8b854912a2cc6e478b6c09b6f98f8436c59907f4 100644
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -42,6 +42,7 @@ namespace {
class ExtensionTabsTest : public InProcessBrowserTest {
};
+class ExtensionWindowCreateTest : public InProcessBrowserTest {};
tapted 2015/03/22 23:05:18 I think the preferred way to do this now is using
}
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetWindow) {
@@ -561,6 +562,22 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) {
keys::kInvalidWindowStateError));
}
+IN_PROC_BROWSER_TEST_F(ExtensionWindowCreateTest, AcceptState) {
+ scoped_refptr<WindowsCreateFunction> function(new WindowsCreateFunction());
+ scoped_refptr<Extension> extension(test_util::CreateEmptyExtension());
+ function->set_extension(extension.get());
+
+ scoped_ptr<base::DictionaryValue> result(
+ utils::ToDictionary(utils::RunFunctionAndReturnSingleResult(
+ function.get(), "[{\"state\": \"fullscreen\"}]", browser(),
+ utils::INCLUDE_INCOGNITO)));
+ int window_id = api_test_utils::GetInteger(result.get(), "id");
+ std::string error;
+ Browser* new_window = ExtensionTabUtil::GetBrowserFromWindowID(
+ function.get(), window_id, &error);
+ EXPECT_TRUE(new_window->window()->IsFullscreen());
+}
+
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DuplicateTab) {
content::OpenURLParams params(GURL(url::kAboutBlankURL),
content::Referrer(),
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698