| 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" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 navigation_observer.Wait(); | 277 navigation_observer.Wait(); |
| 278 | 278 |
| 279 GetManifestAndWait(); | 279 GetManifestAndWait(); |
| 280 EXPECT_TRUE(manifest().IsEmpty()); | 280 EXPECT_TRUE(manifest().IsEmpty()); |
| 281 EXPECT_EQ(6u, console_error_count()); | 281 EXPECT_EQ(6u, console_error_count()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 // If a page has a manifest and the page is navigated to a page without a | 284 // If a page has a manifest and the page is navigated to a page without a |
| 285 // manifest, the page's manifest should be updated. | 285 // manifest, the page's manifest should be updated. |
| 286 IN_PROC_BROWSER_TEST_F(ManifestBrowserTest, Navigation) { | 286 IN_PROC_BROWSER_TEST_F(ManifestBrowserTest, Navigation) { |
| 287 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 287 { | 288 { |
| 288 GURL test_url = GetTestUrl("manifest", "dummy-manifest.html"); | 289 GURL test_url = |
| 290 embedded_test_server()->GetURL("/manifest/dummy-manifest.html"); |
| 289 | 291 |
| 290 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 292 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 291 shell()->LoadURL(test_url); | 293 shell()->LoadURL(test_url); |
| 292 navigation_observer.Wait(); | 294 navigation_observer.Wait(); |
| 293 | 295 |
| 294 GetManifestAndWait(); | 296 GetManifestAndWait(); |
| 295 EXPECT_FALSE(manifest().IsEmpty()); | 297 EXPECT_FALSE(manifest().IsEmpty()); |
| 296 EXPECT_EQ(0u, console_error_count()); | 298 EXPECT_EQ(0u, console_error_count()); |
| 297 } | 299 } |
| 298 | 300 |
| 299 { | 301 { |
| 300 GURL test_url = GetTestUrl("manifest", "no-manifest.html"); | 302 GURL test_url = |
| 303 embedded_test_server()->GetURL("/manifest/no-manifest.html"); |
| 301 | 304 |
| 302 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 305 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 303 shell()->LoadURL(test_url); | 306 shell()->LoadURL(test_url); |
| 304 navigation_observer.Wait(); | 307 navigation_observer.Wait(); |
| 305 | 308 |
| 306 GetManifestAndWait(); | 309 GetManifestAndWait(); |
| 307 EXPECT_TRUE(manifest().IsEmpty()); | 310 EXPECT_TRUE(manifest().IsEmpty()); |
| 308 EXPECT_EQ(0u, console_error_count()); | 311 EXPECT_EQ(0u, console_error_count()); |
| 309 } | 312 } |
| 310 } | 313 } |
| 311 | 314 |
| 312 } // namespace content | 315 } // namespace content |
| OLD | NEW |