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

Side by Side Diff: chrome/browser/ui/webui/uber/uber_ui_browsertest.cc

Issue 1739183003: Make extensions::DictionaryBuilder and extensions::ListValue unmovable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <string> 5 #include <string>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 RunJs("var overrideCalled = false;" 58 RunJs("var overrideCalled = false;"
59 "var uber_frame = {" 59 "var uber_frame = {"
60 " setNavigationOverride: function() {" 60 " setNavigationOverride: function() {"
61 " overrideCalled = true;" 61 " overrideCalled = true;"
62 " }," 62 " },"
63 "};"); 63 "};");
64 64
65 scoped_refptr<const extensions::Extension> extension = 65 scoped_refptr<const extensions::Extension> extension =
66 extensions::ExtensionBuilder() 66 extensions::ExtensionBuilder()
67 .SetManifest(std::move( 67 .SetManifest(
68 extensions::DictionaryBuilder() 68 extensions::DictionaryBuilder()
69 .Set("name", "History Override") 69 .Set("name", "History Override")
70 .Set("version", "1") 70 .Set("version", "1")
71 .Set("manifest_version", 2) 71 .Set("manifest_version", 2)
72 .Set("permission", 72 .Set("permission",
73 std::move(extensions::ListBuilder().Append("history"))))) 73 extensions::ListBuilder().Append("history").Build())
74 .Build())
74 .Build(); 75 .Build();
75 76
76 ExtensionService* service = extensions::ExtensionSystem::Get( 77 ExtensionService* service = extensions::ExtensionSystem::Get(
77 browser()->profile())->extension_service(); 78 browser()->profile())->extension_service();
78 // Load extension. UberUI overrides history navigation. 79 // Load extension. UberUI overrides history navigation.
79 // In this test, injected script will be called instead. 80 // In this test, injected script will be called instead.
80 service->AddExtension(extension.get()); 81 service->AddExtension(extension.get());
81 82
82 EXPECT_TRUE(GetJsBool("overrideCalled")); 83 EXPECT_TRUE(GetJsBool("overrideCalled"));
83 } 84 }
(...skipping 15 matching lines...) Expand all
99 } 100 }
100 101
101 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, 102 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest,
102 EnableSettingsWindowHidesSettingsAndHelp) { 103 EnableSettingsWindowHidesSettingsAndHelp) {
103 base::CommandLine::ForCurrentProcess()->AppendSwitch( 104 base::CommandLine::ForCurrentProcess()->AppendSwitch(
104 ::switches::kEnableSettingsWindow); 105 ::switches::kEnableSettingsWindow);
105 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 106 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
106 SelectTab(); 107 SelectTab();
107 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); 108 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden"));
108 } 109 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698