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

Side by Side Diff: chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)
Patch Set: rebase Created 3 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 | chrome/browser/memory_details.cc » ('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 <string.h> 5 #include <string.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 18 matching lines...) Expand all
29 #include "components/dom_distiller/core/dom_distiller_store.h" 29 #include "components/dom_distiller/core/dom_distiller_store.h"
30 #include "components/dom_distiller/core/dom_distiller_switches.h" 30 #include "components/dom_distiller/core/dom_distiller_switches.h"
31 #include "components/dom_distiller/core/dom_distiller_test_util.h" 31 #include "components/dom_distiller/core/dom_distiller_test_util.h"
32 #include "components/dom_distiller/core/fake_distiller.h" 32 #include "components/dom_distiller/core/fake_distiller.h"
33 #include "components/dom_distiller/core/fake_distiller_page.h" 33 #include "components/dom_distiller/core/fake_distiller_page.h"
34 #include "components/dom_distiller/core/task_tracker.h" 34 #include "components/dom_distiller/core/task_tracker.h"
35 #include "components/dom_distiller/core/url_constants.h" 35 #include "components/dom_distiller/core/url_constants.h"
36 #include "components/dom_distiller/core/url_utils.h" 36 #include "components/dom_distiller/core/url_utils.h"
37 #include "components/leveldb_proto/testing/fake_db.h" 37 #include "components/leveldb_proto/testing/fake_db.h"
38 #include "components/strings/grit/components_strings.h" 38 #include "components/strings/grit/components_strings.h"
39 #include "content/public/browser/render_view_host.h" 39 #include "content/public/browser/render_frame_host.h"
40 #include "content/public/browser/url_data_source.h" 40 #include "content/public/browser/url_data_source.h"
41 #include "content/public/browser/web_contents.h" 41 #include "content/public/browser/web_contents.h"
42 #include "content/public/browser/web_contents_observer.h" 42 #include "content/public/browser/web_contents_observer.h"
43 #include "content/public/common/isolated_world_ids.h" 43 #include "content/public/common/isolated_world_ids.h"
44 #include "content/public/test/browser_test_utils.h" 44 #include "content/public/test/browser_test_utils.h"
45 #include "testing/gmock/include/gmock/gmock.h" 45 #include "testing/gmock/include/gmock/gmock.h"
46 #include "testing/gtest/include/gtest/gtest.h" 46 #include "testing/gtest/include/gtest/gtest.h"
47 #include "ui/base/l10n/l10n_util.h" 47 #include "ui/base/l10n/l10n_util.h"
48 48
49 namespace dom_distiller { 49 namespace dom_distiller {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 ->SetTestingFactoryAndUse(browser()->profile(), &Build); 220 ->SetTestingFactoryAndUse(browser()->profile(), &Build);
221 221
222 // Navigate to a URL which the source should respond to. 222 // Navigate to a URL which the source should respond to.
223 ui_test_utils::NavigateToURL(browser(), url); 223 ui_test_utils::NavigateToURL(browser(), url);
224 224
225 // Ensure no bindings for the loaded |url|. 225 // Ensure no bindings for the loaded |url|.
226 content::WebContents* contents_after_nav = 226 content::WebContents* contents_after_nav =
227 browser()->tab_strip_model()->GetActiveWebContents(); 227 browser()->tab_strip_model()->GetActiveWebContents();
228 ASSERT_TRUE(contents_after_nav != NULL); 228 ASSERT_TRUE(contents_after_nav != NULL);
229 EXPECT_EQ(url, contents_after_nav->GetLastCommittedURL()); 229 EXPECT_EQ(url, contents_after_nav->GetLastCommittedURL());
230 const content::RenderViewHost* render_view_host = 230 const content::RenderFrameHost* render_frame_host =
231 contents_after_nav->GetRenderViewHost(); 231 contents_after_nav->GetMainFrame();
232 EXPECT_EQ(0, render_view_host->GetEnabledBindings()); 232 EXPECT_EQ(0, render_frame_host->GetEnabledBindings());
233 EXPECT_EQ(expected_mime_type, contents_after_nav->GetContentsMimeType()); 233 EXPECT_EQ(expected_mime_type, contents_after_nav->GetContentsMimeType());
234 } 234 }
235 235
236 #if defined(OS_LINUX) 236 #if defined(OS_LINUX)
237 // Flaky on Ubuntu-12.04 bots: https://crbug.com/604362 237 // Flaky on Ubuntu-12.04 bots: https://crbug.com/604362
238 #define MAYBE_TestBadUrlErrorPage DISABLED_TestBadUrlErrorPage 238 #define MAYBE_TestBadUrlErrorPage DISABLED_TestBadUrlErrorPage
239 #else 239 #else
240 #define MAYBE_TestBadUrlErrorPage TestBadUrlErrorPage 240 #define MAYBE_TestBadUrlErrorPage TestBadUrlErrorPage
241 #endif 241 #endif
242 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, 242 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest,
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 EXPECT_EQ("dark serif", result); 646 EXPECT_EQ("dark serif", result);
647 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); 647 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor());
648 648
649 EXPECT_TRUE(content::ExecuteScriptAndExtractString( 649 EXPECT_TRUE(content::ExecuteScriptAndExtractString(
650 contents, kGetFontSize, &result)); 650 contents, kGetFontSize, &result));
651 base::StringToDouble(result, &fontSize); 651 base::StringToDouble(result, &fontSize);
652 ASSERT_FLOAT_EQ(kScale, fontSize/oldFontSize); 652 ASSERT_FLOAT_EQ(kScale, fontSize/oldFontSize);
653 } 653 }
654 654
655 } // namespace dom_distiller 655 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698