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..663f4c2a63315f21bf53f31d733f04b583024bb7 100644 |
| --- a/chrome/browser/extensions/api/tabs/tabs_test.cc |
| +++ b/chrome/browser/extensions/api/tabs/tabs_test.cc |
| @@ -39,9 +39,8 @@ namespace utils = extension_function_test_utils; |
| namespace { |
| -class ExtensionTabsTest : public InProcessBrowserTest { |
| -}; |
| - |
| +using ExtensionTabsTest = InProcessBrowserTest; |
| +using ExtensionWindowCreateTest = InProcessBrowserTest; |
| } |
| IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetWindow) { |
| @@ -561,6 +560,36 @@ 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()); |
|
tapted
2015/04/01 03:41:55
EXPECT_TRUE(error.empty()) ?
limasdf
2015/04/15 23:34:49
Done.
|
| + |
| + function = new WindowsCreateFunction(); |
| + function->set_extension(extension.get()); |
| + result.reset(utils::ToDictionary(utils::RunFunctionAndReturnSingleResult( |
| + function.get(), "[{\"state\": \"minimized\"}]", browser(), |
| + utils::INCLUDE_INCOGNITO))); |
| + window_id = api_test_utils::GetInteger(result.get(), "id"); |
| + new_window = ExtensionTabUtil::GetBrowserFromWindowID(function.get(), |
| + window_id, &error); |
|
tapted
2015/04/01 03:41:55
same here, immediately after this line.
Perhaps a
limasdf
2015/04/15 23:34:49
Done for |error|.
`EXPECT_TRUE(new_window);` is no
|
| +#if !defined(OS_LINUX) || defined(OS_CHROMEOS) |
| + // DesktopWindowTreeHostX11::IsMinimized() relies on an asynchronous update |
| + // from the window server. |
| + EXPECT_TRUE(new_window->window()->IsMinimized()); |
| +#endif |
| +} |
| + |
| IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DuplicateTab) { |
| content::OpenURLParams params(GURL(url::kAboutBlankURL), |
| content::Referrer(), |