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

Side by Side Diff: chrome/browser/extensions/extension_dom_clipboard_apitest.cc

Issue 10535077: TabContentsWrapper -> TabContents, part 12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/stringprintf.h" 5 #include "base/stringprintf.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/test/base/ui_test_utils.h" 8 #include "chrome/test/base/ui_test_utils.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 bool ClipboardApiTest::ExecutePasteInSelectedTab(bool* result) { 60 bool ClipboardApiTest::ExecutePasteInSelectedTab(bool* result) {
61 const wchar_t kScript[] = 61 const wchar_t kScript[] =
62 L"window.domAutomationController.send(document.execCommand('paste'))"; 62 L"window.domAutomationController.send(document.execCommand('paste'))";
63 return ExecuteScriptInSelectedTab(kScript, result); 63 return ExecuteScriptInSelectedTab(kScript, result);
64 } 64 }
65 65
66 bool ClipboardApiTest::ExecuteScriptInSelectedTab(const std::wstring& script, 66 bool ClipboardApiTest::ExecuteScriptInSelectedTab(const std::wstring& script,
67 bool* result) { 67 bool* result) {
68 if (!ui_test_utils::ExecuteJavaScriptAndExtractBool( 68 if (!ui_test_utils::ExecuteJavaScriptAndExtractBool(
69 browser()->GetSelectedWebContents()->GetRenderViewHost(), 69 browser()->GetActiveWebContents()->GetRenderViewHost(),
70 L"", 70 L"",
71 script, 71 script,
72 result)) { 72 result)) {
73 message_ = "Failed to execute script in selected tab."; 73 message_ = "Failed to execute script in selected tab.";
74 return false; 74 return false;
75 } 75 }
76 return true; 76 return true;
77 } 77 }
78 78
79 } // namespace 79 } // namespace
(...skipping 23 matching lines...) Expand all
103 ASSERT_TRUE(LoadHostedApp("hosted_app_no_permission", "main.html")) 103 ASSERT_TRUE(LoadHostedApp("hosted_app_no_permission", "main.html"))
104 << message_; 104 << message_;
105 105
106 bool result = false; 106 bool result = false;
107 ASSERT_TRUE(ExecuteCopyInSelectedTab(&result)) << message_; 107 ASSERT_TRUE(ExecuteCopyInSelectedTab(&result)) << message_;
108 EXPECT_FALSE(result); 108 EXPECT_FALSE(result);
109 ASSERT_TRUE(ExecutePasteInSelectedTab(&result)) << message_; 109 ASSERT_TRUE(ExecutePasteInSelectedTab(&result)) << message_;
110 EXPECT_FALSE(result); 110 EXPECT_FALSE(result);
111 } 111 }
112 112
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_devtools_bridge.cc ('k') | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698