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

Side by Side Diff: chrome/browser/ui/views/collected_cookies_views_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase bug. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/content_settings/cookie_settings_factory.h" 5 #include "chrome/browser/content_settings/cookie_settings_factory.h"
6 #include "chrome/browser/infobars/infobar_service.h" 6 #include "chrome/browser/infobars/infobar_service.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "chrome/browser/ui/views/collected_cookies_views.h" 9 #include "chrome/browser/ui/views/collected_cookies_views.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
11 #include "chrome/test/base/ui_test_utils.h" 11 #include "chrome/test/base/ui_test_utils.h"
12 #include "components/content_settings/core/browser/cookie_settings.h" 12 #include "components/content_settings/core/browser/cookie_settings.h"
13 #include "net/test/embedded_test_server/embedded_test_server.h" 13 #include "net/test/embedded_test_server/embedded_test_server.h"
14 14
15 class CollectedCookiesViewsTest : public InProcessBrowserTest { 15 class CollectedCookiesViewsTest : public InProcessBrowserTest {
16 public: 16 public:
17 void SetUpOnMainThread() override { 17 void SetUpOnMainThread() override {
18 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 18 ASSERT_TRUE(embedded_test_server()->Start());
19 19
20 // Disable cookies. 20 // Disable cookies.
21 CookieSettingsFactory::GetForProfile(browser()->profile()) 21 CookieSettingsFactory::GetForProfile(browser()->profile())
22 ->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); 22 ->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK);
23 23
24 // Load a page with cookies. 24 // Load a page with cookies.
25 ui_test_utils::NavigateToURL( 25 ui_test_utils::NavigateToURL(
26 browser(), embedded_test_server()->GetURL("/cookie1.html")); 26 browser(), embedded_test_server()->GetURL("/cookie1.html"));
27 27
28 // Spawn a cookies dialog. Note that |cookies_dialog_| will delete itself 28 // Spawn a cookies dialog. Note that |cookies_dialog_| will delete itself
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Test closing tab after changing dialog data. Changed dialog should not 77 // Test closing tab after changing dialog data. Changed dialog should not
78 // show infobar or crash because InfoBarService is gone. 78 // show infobar or crash because InfoBarService is gone.
79 79
80 SetDialogChanged(); 80 SetDialogChanged();
81 81
82 // Closing the owning tab will close dialog. 82 // Closing the owning tab will close dialog.
83 browser()->tab_strip_model()->GetActiveWebContents()->Close(); 83 browser()->tab_strip_model()->GetActiveWebContents()->Close();
84 84
85 EXPECT_EQ(0u, infobar_count()); 85 EXPECT_EQ(0u, infobar_count());
86 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698