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

Side by Side Diff: chrome/browser/extensions/api/browser/browser_apitest.cc

Issue 245933002: Initial implementation of chrome.browser.openTab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing. Created 6 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/stringprintf.h"
9 #include "base/values.h"
10 #include "chrome/browser/extensions/api/browser/browser_api.h"
11 #include "chrome/browser/extensions/extension_function_test_utils.h"
12 #include "chrome/test/base/in_process_browser_test.h"
13
14 namespace extensions {
15
16 namespace utils = extension_function_test_utils;
17
18 namespace {
19
20 class BrowserApiTest : public InProcessBrowserTest {
21 };
22
23 }
24
25 IN_PROC_BROWSER_TEST_F(BrowserApiTest, OpenTab) {
26 std::string url = "about:blank";
miket_OOO 2014/04/28 18:24:35 Would a different URL be a better test? For exampl
rpaquay 2014/04/28 19:44:12 Agreed. I only added a "sanity check" test at this
27
28 scoped_refptr<api::BrowserOpenTabFunction> function =
29 new api::BrowserOpenTabFunction();
30 scoped_refptr<Extension> extension(utils::CreateEmptyExtension());
31 function->set_extension(extension.get());
32 base::Value* result = utils::RunFunctionAndReturnSingleResult(
33 function.get(),
34 base::StringPrintf("[{\"url\":\"%s\"}]", url.c_str()),
35 browser());
36
37 // result is currently NULL on success.
38 EXPECT_FALSE(result);
miket_OOO 2014/04/28 18:24:35 Is there a failure case? I see the IDL has a void
rpaquay 2014/04/28 19:44:12 The failure cases would be reported through "chrom
39 }
40
41 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698