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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 275 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
276 shell()->LoadURL(test_url); | 276 shell()->LoadURL(test_url); |
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 |
| 285 // manifest, the page's manifest should be updated. |
| 286 IN_PROC_BROWSER_TEST_F(ManifestBrowserTest, Navigation) { |
| 287 { |
| 288 GURL test_url = GetTestUrl("manifest", "dummy-manifest.html"); |
| 289 |
| 290 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 291 shell()->LoadURL(test_url); |
| 292 navigation_observer.Wait(); |
| 293 |
| 294 GetManifestAndWait(); |
| 295 EXPECT_FALSE(manifest().IsEmpty()); |
| 296 EXPECT_EQ(0u, console_error_count()); |
| 297 } |
| 298 |
| 299 { |
| 300 GURL test_url = GetTestUrl("manifest", "no-manifest.html"); |
| 301 |
| 302 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 303 shell()->LoadURL(test_url); |
| 304 navigation_observer.Wait(); |
| 305 |
| 306 GetManifestAndWait(); |
| 307 EXPECT_TRUE(manifest().IsEmpty()); |
| 308 EXPECT_EQ(0u, console_error_count()); |
| 309 } |
| 310 } |
| 311 |
284 } // namespace content | 312 } // namespace content |
OLD | NEW |