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

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: switch default 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
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..5bbe4fdf762b942ce9798a8dad0b571f860e4fe9 100644
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -42,8 +42,30 @@ namespace {
class ExtensionTabsTest : public InProcessBrowserTest {
};
+class ExtensionWindowCreateTest : public InProcessBrowserTest {
+ public:
+ void SetUpOnMainThread() override;
+
+ // Run chrome.windows.create(). If success, return |true|.
+ bool RunCreateWindow(const std::string& args);
+
+ private:
+ scoped_refptr<Extension> extension_;
+};
+
+void ExtensionWindowCreateTest::SetUpOnMainThread() {
+ extension_ = test_util::CreateEmptyExtension();
+}
+
+bool ExtensionWindowCreateTest::RunCreateWindow(const std::string& args) {
+ scoped_refptr<WindowsCreateFunction> function(new WindowsCreateFunction());
+ function->set_extension(extension_.get());
+ return extensions::api_test_utils::RunFunction(function.get(), args,
+ browser()->profile());
}
+} // namespace
+
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetWindow) {
int window_id = ExtensionTabUtil::GetWindowId(browser());
@@ -561,6 +583,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) {
keys::kInvalidWindowStateError));
}
+IN_PROC_BROWSER_TEST_F(ExtensionWindowCreateTest, ValidateCreateWindowState) {
+ EXPECT_TRUE(RunCreateWindow("[{\"state\": \"fullscreen\"}]"));
not at google - send to devlin 2015/03/19 17:56:31 What is this testing? If anything I would have th
limasdf 2015/03/20 17:03:46 Done. But fullscreen test is added only. It looks
+ EXPECT_TRUE(RunCreateWindow("[{\"state\": \"maximized\"}]"));
+ EXPECT_TRUE(RunCreateWindow("[{\"state\": \"minimized\"}]"));
+ EXPECT_TRUE(RunCreateWindow("[{\"state\": \"normal\"}]"));
+}
+
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DuplicateTab) {
content::OpenURLParams params(GURL(url::kAboutBlankURL),
content::Referrer(),

Powered by Google App Engine
This is Rietveld 408576698