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

Side by Side Diff: chrome/renderer/content_settings_observer_browsertest.cc

Issue 2807723002: Use SameDocument term instead of SamePage in chrome tests. (Closed)
Patch Set: Self review Created 3 years, 8 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 | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "chrome/common/render_messages.h" 7 #include "chrome/common/render_messages.h"
8 #include "chrome/renderer/content_settings_observer.h" 8 #include "chrome/renderer/content_settings_observer.h"
9 #include "chrome/test/base/chrome_render_view_test.h" 9 #include "chrome/test/base/chrome_render_view_test.h"
10 #include "components/content_settings/core/common/content_settings.h" 10 #include "components/content_settings/core/common/content_settings.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 .utf8() 383 .utf8()
384 .find("JS_ENABLED")); 384 .find("JS_ENABLED"));
385 EXPECT_EQ( 385 EXPECT_EQ(
386 std::string::npos, 386 std::string::npos,
387 blink::WebFrameContentDumper::dumpLayoutTreeAsText( 387 blink::WebFrameContentDumper::dumpLayoutTreeAsText(
388 GetMainFrame(), blink::WebFrameContentDumper::LayoutAsTextNormal) 388 GetMainFrame(), blink::WebFrameContentDumper::LayoutAsTextNormal)
389 .utf8() 389 .utf8()
390 .find("JS_DISABLED")); 390 .find("JS_DISABLED"));
391 } 391 }
392 392
393 // Checks that same page navigations don't update content settings for the page. 393 // Checks that same document navigations don't update content settings for the
394 TEST_F(ChromeRenderViewTest, ContentSettingsSamePageNavigation) { 394 // page.
395 TEST_F(ChromeRenderViewTest, ContentSettingsSameDocumentNavigation) {
395 MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame()); 396 MockContentSettingsObserver mock_observer(view_->GetMainRenderFrame());
396 // Load a page which contains a script. 397 // Load a page which contains a script.
397 const char kHtml[] = 398 const char kHtml[] =
398 "<html>" 399 "<html>"
399 "<head>" 400 "<head>"
400 "<script src='data:foo'></script>" 401 "<script src='data:foo'></script>"
401 "</head>" 402 "</head>"
402 "<body>" 403 "<body>"
403 "</body>" 404 "</body>"
404 "</html>"; 405 "</html>";
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 ContentSettingPatternSource( 516 ContentSettingPatternSource(
516 ContentSettingsPattern::Wildcard(), 517 ContentSettingsPattern::Wildcard(),
517 ContentSettingsPattern::Wildcard(), 518 ContentSettingsPattern::Wildcard(),
518 CONTENT_SETTING_BLOCK, 519 CONTENT_SETTING_BLOCK,
519 std::string(), 520 std::string(),
520 false)); 521 false));
521 522
522 EXPECT_FALSE(observer->allowAutoplay(true)); 523 EXPECT_FALSE(observer->allowAutoplay(true));
523 ::testing::Mock::VerifyAndClearExpectations(&observer); 524 ::testing::Mock::VerifyAndClearExpectations(&observer);
524 } 525 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698