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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 249633002: Detect <link rel='manifest'> and notify embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/tests/data/link-manifest-change.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 5385 matching lines...) Expand 10 before | Expand all | Expand 10 after
5396 TEST_F(WebFrameTest, HasVisibleContentOnHiddenFrames) 5396 TEST_F(WebFrameTest, HasVisibleContentOnHiddenFrames)
5397 { 5397 {
5398 registerMockedHttpURLLoad("hidden_frames.html"); 5398 registerMockedHttpURLLoad("hidden_frames.html");
5399 FrameTestHelpers::WebViewHelper webViewHelper; 5399 FrameTestHelpers::WebViewHelper webViewHelper;
5400 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "hidd en_frames.html"); 5400 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "hidd en_frames.html");
5401 for (WebFrame* frame = webViewImpl->mainFrameImpl()->traverseNext(false); fr ame; frame = frame->traverseNext(false)) { 5401 for (WebFrame* frame = webViewImpl->mainFrameImpl()->traverseNext(false); fr ame; frame = frame->traverseNext(false)) {
5402 EXPECT_FALSE(frame->hasVisibleContent()); 5402 EXPECT_FALSE(frame->hasVisibleContent());
5403 } 5403 }
5404 } 5404 }
5405 5405
5406 class ManifestChangeWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
5407 public:
5408 ManifestChangeWebFrameClient() : m_manifestChangeCount(0) { }
5409 virtual void didChangeManifest(WebLocalFrame*) OVERRIDE
5410 {
5411 ++m_manifestChangeCount;
5412 }
5413
5414 int manifestChangeCount() { return m_manifestChangeCount; }
5415
5416 private:
5417 int m_manifestChangeCount;
5418 };
5419
5420 TEST_F(WebFrameTest, NotifyManifestChange)
5421 {
5422 registerMockedHttpURLLoad("link-manifest-change.html");
5423
5424 ManifestChangeWebFrameClient webFrameClient;
5425 FrameTestHelpers::WebViewHelper webViewHelper;
5426 webViewHelper.initializeAndLoad(m_baseURL + "link-manifest-change.html", tru e, &webFrameClient);
5427
5428 EXPECT_EQ(14, webFrameClient.manifestChangeCount());
5429 }
5430
5406 } // namespace 5431 } // namespace
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/tests/data/link-manifest-change.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698