| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "content/public/browser/web_contents.h" | 6 #include "content/public/browser/web_contents.h" |
| 7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.h" |
| 8 #include "content/public/common/manifest.h" | 8 #include "content/public/common/manifest.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/content_browser_test.h" | 10 #include "content/public/test/content_browser_test.h" |
| 11 #include "content/public/test/content_browser_test_utils.h" | 11 #include "content/public/test/content_browser_test_utils.h" |
| 12 #include "content/public/test/test_navigation_observer.h" | 12 #include "content/public/test/test_navigation_observer.h" |
| 13 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
| 14 #include "net/test/embedded_test_server/embedded_test_server.h" | 14 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class ManifestBrowserTest : public ContentBrowserTest { | 18 class ManifestBrowserTest : public ContentBrowserTest { |
| 19 protected: | 19 protected: |
| 20 ManifestBrowserTest() {} | 20 ManifestBrowserTest() {} |
| 21 virtual ~ManifestBrowserTest() {} | 21 ~ManifestBrowserTest() override {} |
| 22 | 22 |
| 23 void GetManifestAndWait() { | 23 void GetManifestAndWait() { |
| 24 shell()->web_contents()->GetManifest( | 24 shell()->web_contents()->GetManifest( |
| 25 base::Bind(&ManifestBrowserTest::OnGetManifest, | 25 base::Bind(&ManifestBrowserTest::OnGetManifest, |
| 26 base::Unretained(this))); | 26 base::Unretained(this))); |
| 27 | 27 |
| 28 message_loop_runner_ = new MessageLoopRunner(); | 28 message_loop_runner_ = new MessageLoopRunner(); |
| 29 message_loop_runner_->Run(); | 29 message_loop_runner_->Run(); |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 std::string manifest_url = | 193 std::string manifest_url = |
| 194 https_server->GetURL("/manifest/dummy-manifest.json").spec(); | 194 https_server->GetURL("/manifest/dummy-manifest.json").spec(); |
| 195 ASSERT_TRUE(content::ExecuteScript(shell()->web_contents(), | 195 ASSERT_TRUE(content::ExecuteScript(shell()->web_contents(), |
| 196 "setManifestTo('" + manifest_url + "')")); | 196 "setManifestTo('" + manifest_url + "')")); |
| 197 | 197 |
| 198 GetManifestAndWait(); | 198 GetManifestAndWait(); |
| 199 EXPECT_TRUE(manifest().IsEmpty()); | 199 EXPECT_TRUE(manifest().IsEmpty()); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace content | 202 } // namespace content |
| OLD | NEW |