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

Issue 7044091: Re-enable SSL UI tests after providing browser that once again allows (Closed)

Created:
9 years, 6 months ago by Tom Sepez
Modified:
9 years, 6 months ago
Reviewers:
abarth-chromium
CC:
chromium-reviews
Visibility:
Public.

Description

Re-enable SSL UI tests after providing browser that once again allows insecure content. While I'm here, it would be a shame not to add cases covering the opposite situation, where the browser blocks everything. BUG=85475 TEST=browser_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88590

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -7 lines) Patch
M chrome/browser/ssl/ssl_browser_tests.cc View 7 chunks +59 lines, -7 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Tom Sepez
Adam, please review. Thanks heaps.
9 years, 6 months ago (2011-06-09 19:30:57 UTC) #1
abarth-chromium
9 years, 6 months ago (2011-06-09 20:55:50 UTC) #2
LGTM!!

On Thu, Jun 9, 2011 at 12:30 PM,  <tsepez@chromium.org> wrote:
> Reviewers: abarth,
>
> Message:
> Adam, please review.  Thanks heaps.
>
> Description:
> Re-enable SSL UI tests after providing browser that once again allows
> insecure content.  While I'm here, it would be a shame not to add cases
> covering the opposite situation, where the browser blocks everything.
>
> Please review this at http://codereview.chromium.org/7044091/
>
> SVN Base: svn://svn.chromium.org/chrome/trunk/src/
>
> Affected files:
>  M     chrome/browser/ssl/ssl_browser_tests.cc
>
>
> Index: chrome/browser/ssl/ssl_browser_tests.cc
> ===================================================================
> --- chrome/browser/ssl/ssl_browser_tests.cc     (revision 88546)
> +++ chrome/browser/ssl/ssl_browser_tests.cc     (working copy)
> @@ -2,12 +2,14 @@
>  // Use of this source code is governed by a BSD-style license that can be
>  // found in the LICENSE file.
>
> +#include "base/command_line.h"
>  #include "base/time.h"
>  #include "chrome/app/chrome_command_ids.h"
>  #include "chrome/browser/tabs/tab_strip_model.h"
>  #include "chrome/browser/ui/browser.h"
>  #include "chrome/browser/ui/browser_navigator.h"
>  #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
> +#include "chrome/common/chrome_switches.h"
>  #include "chrome/test/in_process_browser_test.h"
>  #include "chrome/test/ui_test_utils.h"
>  #include "content/browser/renderer_host/render_view_host.h"
> @@ -34,6 +36,11 @@
>     EnableDOMAutomation();
>   }
>
> +  // Browser will both run and display insecure content.
> +  virtual void SetUpCommandLine(CommandLine* command_line) {
> +    command_line->AppendSwitch(switches::kAllowRunningInsecureContent);
> +  }
> +
>   void CheckAuthenticatedState(TabContents* tab,
>                                bool displayed_insecure_content) {
>     NavigationEntry* entry = tab->controller().GetActiveEntry();
> @@ -197,6 +204,16 @@
>   DISALLOW_COPY_AND_ASSIGN(SSLUITest);
>  };
>
> +class SSLUITestBlock : public SSLUITest {
> + public:
> +  SSLUITestBlock() : SSLUITest() {}
> +
> +  // Browser will neither run nor display insecure content.
> +  virtual void SetUpCommandLine(CommandLine* command_line) {
> +    command_line->AppendSwitch(switches::kNoDisplayingInsecureContent);
> +  }
> +};
> +
>  // Visits a regular page over http.
>  IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) {
>   ASSERT_TRUE(test_server()->Start());
> @@ -455,9 +472,8 @@
>  // Visits a page that runs insecure content and tries to suppress the
> insecure
>  // content warnings by randomizing location.hash.
>  // Based on http://crbug.com/8706
> -// Disabled, http://crbug.com/85475.
>  IN_PROC_BROWSER_TEST_F(SSLUITest,
> -                       DISABLED_TestRunsInsecuredContentRandomizeHash) {
> +                       TestRunsInsecuredContentRandomizeHash) {
>   ASSERT_TRUE(test_server()->Start());
>   ASSERT_TRUE(https_server_.Start());
>
> @@ -580,8 +596,7 @@
>  // Visits two pages from the same origin: one that runs insecure content
> and one
>  // that doesn't.  The test checks that we propagate the insecure content
> state
>  // from one to the other.
> -// Disabled, http://crbug.com/85475.
> -IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestRunsInsecureContentTwoTabs)
> {
> +IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsInsecureContentTwoTabs) {
>   ASSERT_TRUE(test_server()->Start());
>   ASSERT_TRUE(https_server_.Start());
>
> @@ -647,9 +662,7 @@
>  #define MAYBE_TestRunsCachedInsecureContent \
>     DISABLED_TestRunsCachedInsecureContent
>  #else
> -// Disabled, http://crbug.com/85475.
> -#define MAYBE_TestRunsCachedInsecureContent \
> -    DISABLED_TestRunsCachedInsecureContent
> +#define MAYBE_TestRunsCachedInsecureContent TestRunsCachedInsecureContent
>  #endif  // defined(OS_CHROMEOS)
>
>  // Visits a page with script over http.  Visits another page over https
> @@ -1120,6 +1133,45 @@
>   CheckAuthenticationBrokenState(tab, 0, true, false);
>  }
>
> +// Test that when the browser blocks displaying insecure content, the
> +// indicator shows a secure page, because the blocking made the otherwise
> +// unsafe page safe (the notification of this state is handled by other
> means).
> +IN_PROC_BROWSER_TEST_F(SSLUITestBlock, TestBlockDisplayingInsecureContent)
> {
> +  ASSERT_TRUE(test_server()->Start());
> +  ASSERT_TRUE(https_server_.Start());
> +
> +  std::string replacement_path;
> +  ASSERT_TRUE(GetFilePathWithHostAndPortReplacement(
> +      "files/ssl/page_displays_insecure_content.html",
> +      test_server()->host_port_pair(),
> +      &replacement_path));
> +
> +  ui_test_utils::NavigateToURL(browser(),
> +                               https_server_.GetURL(replacement_path));
> +
> +  CheckAuthenticatedState(browser()->GetSelectedTabContents(), false);
> +}
> +
> +// Test that when the browser blocks running insecure content, the
> +// indicator shows a secure page, because the blocking made the otherwise
> +// unsafe page safe (the notification of this state is handled by other
> means).
> +IN_PROC_BROWSER_TEST_F(SSLUITestBlock, TestBlockRunningInsecureContent) {
> +  ASSERT_TRUE(test_server()->Start());
> +  ASSERT_TRUE(https_server_.Start());
> +
> +  std::string replacement_path;
> +  ASSERT_TRUE(GetFilePathWithHostAndPortReplacement(
> +      "files/ssl/page_runs_insecure_content.html",
> +      test_server()->host_port_pair(),
> +      &replacement_path));
> +
> +  ui_test_utils::NavigateToURL(browser(),
> +                               https_server_.GetURL(replacement_path));
> +
> +  CheckAuthenticatedState(browser()->GetSelectedTabContents(), false);
> +}
> +
> +
>  // TODO(jcampan): more tests to do below.
>
>  // Visit a page over https that contains a frame with a redirect.
>
>
>

Powered by Google App Engine
This is Rietveld 408576698