Chromium Code Reviews| 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(), |