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

Unified Diff: extensions/browser/api/document_scan/document_scan_api_unittest.cc

Issue 899523004: Move chrome.documentScan API to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated DEPS Created 5 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/document_scan/document_scan_api_unittest.cc
diff --git a/chrome/browser/extensions/api/document_scan/document_scan_api_unittest.cc b/extensions/browser/api/document_scan/document_scan_api_unittest.cc
similarity index 80%
rename from chrome/browser/extensions/api/document_scan/document_scan_api_unittest.cc
rename to extensions/browser/api/document_scan/document_scan_api_unittest.cc
index 73043052efa1282fd410348225475e051c3485bb..1c8f5971d3e66ee5e44691e9a10f418f57fb5b88 100644
--- a/chrome/browser/extensions/api/document_scan/document_scan_api_unittest.cc
+++ b/extensions/browser/api/document_scan/document_scan_api_unittest.cc
@@ -1,24 +1,25 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/api/document_scan/document_scan_api.h"
+
+#include "extensions/browser/api/document_scan/document_scan_api.h"
#include <string>
#include <vector>
-#include "chrome/browser/extensions/api/document_scan/mock_document_scan_interface.h"
-#include "chrome/browser/extensions/extension_api_unittest.h"
-#include "chrome/browser/extensions/extension_function_test_utils.h"
+#include "extensions/browser/api/document_scan/mock_document_scan_interface.h"
+#include "extensions/browser/api_test_utils.h"
+#include "extensions/browser/api_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
using testing::_;
namespace extensions {
-namespace api {
+namespace core_api {
// Tests of networking_private_crypto support for Networking Private API.
-class DocumentScanScanFunctionTest : public ExtensionApiUnittest {
+class DocumentScanScanFunctionTest : public ApiUnitTest {
public:
DocumentScanScanFunctionTest()
: function_(new DocumentScanScanFunction()),
@@ -26,7 +27,7 @@ class DocumentScanScanFunctionTest : public ExtensionApiUnittest {
~DocumentScanScanFunctionTest() override {}
void SetUp() override {
- ExtensionApiUnittest::SetUp();
+ ApiUnitTest::SetUp();
// Passes ownership.
function_->document_scan_interface_.reset(document_scan_interface_);
}
@@ -34,10 +35,8 @@ class DocumentScanScanFunctionTest : public ExtensionApiUnittest {
protected:
std::string RunFunctionAndReturnError(const std::string& args) {
function_->set_extension(extension());
- std::string error =
- extension_function_test_utils::RunFunctionAndReturnError(
- function_, args, browser(),
- extension_function_test_utils::NONE);
+ std::string error = api_test_utils::RunFunctionAndReturnError(
+ function_, args, browser_context(), api_test_utils::NONE);
return error;
}
@@ -62,10 +61,8 @@ TEST_F(DocumentScanScanFunctionTest, NoScanners) {
function_->set_user_gesture(true);
EXPECT_CALL(*document_scan_interface_, ListScanners(_))
.WillOnce(InvokeListScannersCallback(
- std::vector<DocumentScanInterface::ScannerDescription>(),
- ""));
- EXPECT_EQ("Scanner not available",
- RunFunctionAndReturnError("[{}]"));
+ std::vector<DocumentScanInterface::ScannerDescription>(), ""));
+ EXPECT_EQ("Scanner not available", RunFunctionAndReturnError("[{}]"));
}
TEST_F(DocumentScanScanFunctionTest, NoMatchingScanners) {
@@ -109,8 +106,8 @@ TEST_F(DocumentScanScanFunctionTest, Success) {
EXPECT_CALL(*document_scan_interface_, Scan(_, _, _, _))
.WillOnce(InvokeScanCallback(kScanData, kMimeType, ""));
function_->set_user_gesture(true);
- scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDictionary(
- function_, "[{}]"));
+ scoped_ptr<base::DictionaryValue> result(
+ RunFunctionAndReturnDictionary(function_, "[{}]"));
ASSERT_NE(nullptr, result.get());
document_scan::ScanResults scan_results;
EXPECT_TRUE(document_scan::ScanResults::Populate(*result, &scan_results));
@@ -118,6 +115,6 @@ TEST_F(DocumentScanScanFunctionTest, Success) {
EXPECT_EQ(kMimeType, scan_results.mime_type);
}
-} // namespace api
+} // namespace core_api
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698