This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10589 from brave/fix/dnd
block drag and drop data from Brave inside webviews
- Loading branch information
Showing
4 changed files
with
82 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
/* global describe, it */ | ||
|
||
const dndData = require('../../js/dndData') | ||
const assert = require('assert') | ||
|
||
describe('dndData', function () { | ||
describe('hasBraveDragData', function () { | ||
it('returns false for empty transfer', () => { | ||
assert.equal(dndData.hasBraveDragData(), false) | ||
assert.equal(dndData.hasBraveDragData({types: []}), false) | ||
assert.equal(dndData.hasBraveDragData({}), false) | ||
}) | ||
it('returns false for regular transfer', () => { | ||
assert.equal(dndData.hasBraveDragData({types: ['text/plain']}), false) | ||
assert.equal(dndData.hasBraveDragData({types: ['text/plain', 'text/html']}), false) | ||
}) | ||
it('returns true for brave transfer', () => { | ||
assert.equal(dndData.hasBraveDragData({types: ['application/x-brave-tab']}), true) | ||
assert.equal(dndData.hasBraveDragData({types: ['text/plain', 'text/uri-list', 'application/x-brave-bookmark']}), true) | ||
}) | ||
}) | ||
}) |