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

Unified Diff: base/test/android/java/src/org/chromium/base/ContentUriTestUtils.java

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « base/test/android/OWNERS ('k') | base/test/android/java/src/org/chromium/base/TestUiThread.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/android/java/src/org/chromium/base/ContentUriTestUtils.java
diff --git a/base/test/android/java/src/org/chromium/base/ContentUriTestUtils.java b/base/test/android/java/src/org/chromium/base/ContentUriTestUtils.java
deleted file mode 100644
index 4a1613b4f644621e0cb1e5d0a5186c07e71f3371..0000000000000000000000000000000000000000
--- a/base/test/android/java/src/org/chromium/base/ContentUriTestUtils.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2013 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.
-
-package org.chromium.base;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.net.Uri;
-import android.provider.MediaStore;
-
-/**
- * Utilities for testing operations on content URI.
- */
-public class ContentUriTestUtils {
- /**
- * Insert an image into the MediaStore, and return the content URI. If the
- * image already exists in the MediaStore, just retrieve the URI.
- *
- * @param context Application context.
- * @param path Path to the image file.
- * @return Content URI of the image.
- */
- @CalledByNative
- private static String insertImageIntoMediaStore(Context context, String path) {
- // Check whether the content URI exists.
- Cursor c = context.getContentResolver().query(
- MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
- new String[] { MediaStore.Video.VideoColumns._ID },
- MediaStore.Images.Media.DATA + " LIKE ?",
- new String[] { path },
- null);
- if (c != null && c.getCount() > 0) {
- c.moveToFirst();
- int id = c.getInt(0);
- return Uri.withAppendedPath(
- MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "" + id).toString();
- }
-
- // Insert the content URI into MediaStore.
- ContentValues values = new ContentValues();
- values.put(MediaStore.MediaColumns.DATA, path);
- Uri uri = context.getContentResolver().insert(
- MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
- return uri.toString();
- }
-}
« no previous file with comments | « base/test/android/OWNERS ('k') | base/test/android/java/src/org/chromium/base/TestUiThread.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698