Chromium Code Reviews| Index: headless/lib/headless_browser_browsertest.cc |
| diff --git a/headless/lib/headless_browser_browsertest.cc b/headless/lib/headless_browser_browsertest.cc |
| index 9cc594073cef0d6aa78bdb2c4ff4f8c6b55923ad..84bdcaea0dd882bea66ef597cc165b976b9f5db6 100644 |
| --- a/headless/lib/headless_browser_browsertest.cc |
| +++ b/headless/lib/headless_browser_browsertest.cc |
| @@ -15,18 +15,24 @@ |
| namespace headless { |
| IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, CreateAndDestroyWebContents) { |
| - std::unique_ptr<HeadlessWebContents> web_contents = |
| + HeadlessWebContents* web_contents = |
| browser()->CreateWebContents(GURL("about:blank"), gfx::Size(800, 600)); |
| EXPECT_TRUE(web_contents); |
| + |
| + EXPECT_EQ(browser()->GetAllWebContents().size(), static_cast<size_t>(1)); |
|
Sami
2016/04/20 16:38:50
EXPECT_EQ(expected, actual) (here and elsewhere)
altimin
2016/04/20 17:35:25
Done.
|
| + EXPECT_EQ(browser()->GetAllWebContents()[0], web_contents); |
| // TODO(skyostil): Verify viewport dimensions once we can. |
| - web_contents.reset(); |
| + web_contents->Close(); |
| + |
| + EXPECT_TRUE(browser()->GetAllWebContents().empty()); |
| } |
| IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, CreateWithBadURL) { |
| GURL bad_url("not_valid"); |
| - std::unique_ptr<HeadlessWebContents> web_contents = |
| + HeadlessWebContents* web_contents = |
| browser()->CreateWebContents(bad_url, gfx::Size(800, 600)); |
| EXPECT_FALSE(web_contents); |
| + EXPECT_TRUE(browser()->GetAllWebContents().empty()); |
| } |
| class HeadlessBrowserTestWithProxy : public HeadlessBrowserTest { |
| @@ -60,11 +66,16 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTestWithProxy, SetProxyServer) { |
| // Load a page which doesn't actually exist, but for which the our proxy |
| // returns valid content anyway. |
| - std::unique_ptr<HeadlessWebContents> web_contents = |
| - browser()->CreateWebContents( |
| - GURL("http://not-an-actual-domain.tld/hello.html"), |
| - gfx::Size(800, 600)); |
| - EXPECT_TRUE(WaitForLoad(web_contents.get())); |
| + // |
| + // TODO(headless-dev): Currently this construction does not serve hello.html |
|
Sami
2016/04/20 16:38:50
TODO(altimin) since this mailing list style isn't
altimin
2016/04/20 17:35:25
Done.
|
| + // from headless/test/data as expected. We should fix this. |
| + HeadlessWebContents* web_contents = browser()->CreateWebContents( |
| + GURL("http://not-an-actual-domain.tld/hello.html"), gfx::Size(800, 600)); |
| + EXPECT_TRUE(WaitForLoad(web_contents)); |
| + EXPECT_EQ(browser()->GetAllWebContents().size(), static_cast<size_t>(1)); |
| + EXPECT_EQ(browser()->GetAllWebContents()[0], web_contents); |
| + web_contents->Close(); |
| + EXPECT_TRUE(browser()->GetAllWebContents().empty()); |
| } |
| } // namespace headless |