Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: content/browser/manifest/manifest_browsertest.cc

Issue 896823002: [Manifest] Update a RenderFrame's Manifest when navigated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/manifest/manifest_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | content/renderer/manifest/manifest_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698