Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

New electron dialog changes #11906

Merged
merged 2 commits into from
Jan 29, 2018
Merged

New electron dialog changes #11906

merged 2 commits into from
Jan 29, 2018

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Nov 11, 2017

requires brave/muon#385

fix #1985
fix #3313
fix #3784
fix #3864
fix #8096
fix #8854
fix #9409
fix #9435
fix #10260
fix #10653
fix #11452

Auditors: @bridiver, @bbondy, @bsclifton

Test Plan:

a. download things from web page

  1. Go to https://brave.com/about/images/brave_icon_512x.png
  2. Save Image
  3. The dialog should have extension option with png
  4. The default path should be your download path
  5. Test it can be saved or cancel successfully

b. dev tools performance profile upload/download

  1. Open dev tools and go to Performance
  2. Hit Record to generate the profile
  3. Save Profile
  4. The default path should be your download path
  5. Test it can be saved or cancel successfully
  6. Upload Profile
  7. Test it can be uploaded and accepted by devtool

c. Ledger recovery file

  1. Go to about:preferences#payments
  2. Recover your wallet by import recovery key
  3. The default path should be your user profile
  4. The dialog should have extension option with txt
  5. Test it can be imported or cancel successfully

d. export bookmark

  1. Menu->Bookmarks->Export bookmarks
  2. The default path should be your download path
  3. The dialog should have extension option with html
  4. Default extension is html
  5. Test it can be saved or cancel successfully

c. import bookmark by html

  1. Menu->Bookmarks->Import Browser Data.. and select HTML file
  2. The default path should be your download path
  3. The dialog should have extension option with html
  4. Default extension is html
  5. Test it can be imported or cancel successfully

d. Open Files

  1. Menu->File->Open File...
  2. The default path should be your download path
  3. Make sure you can multiple select
  4. (Linux) If you choose pictures, there should be preview
  5. Test they can be imported or cancel successfully

e. torrent download

  1. Go to https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/debian-9.2.1-amd64-netinst.iso.torrent
  2. Click Save Torrent File...
  3. The default path should be your download path
  4. The dialog should have extension option with torrent
  5. Test it can be saved or cancel successfully

f. Webpage save

  1. Go to https://brave.com/
  2. Context Menu-> Save Page as..
  3. The default path should be your download path
  4. The dialog should have extension option with html
  5. Test it can be saved or cancel successfully

g. Save link

  1. Go to https://brave.com/
  2. Right click on Download Brave
  3. Save Link As
  4. The default path should be your download path
  5. The dialog should have extension option with dmg/exe/deb
  6. Test it can be saved or cancel successfully

h. Test esc

  1. Go to https://brave.com/
  2. Context Menu-> Save Page as..
  3. Press ESC
  4. Dialog should be dismissed

i Image preview (Linux)

  1. Go to https://imgur.com/
  2. Click New Post and browser files
  3. Click on any images
  4. There will be a preview on the side

j Set Download path

  1. Open brave with new profile
  2. Got to about:preferences#general
  3. Choose where to download a file
  4. Download path can be set

k PDF download

  1. Visit http://orimi.com/pdf-test.pdf
  2. Click on Download pdf
  3. The dialog should have extension option with pdf
  4. Test it can be saved or cancel successfully

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@darkdh
Copy link
Member Author

darkdh commented Nov 16, 2017

Test plan specified. Ready for review

@codecov-io
Copy link

codecov-io commented Jan 12, 2018

Codecov Report

Merging #11906 into master will decrease coverage by <.01%.
The diff coverage is 5%.

@@            Coverage Diff             @@
##           master   #11906      +/-   ##
==========================================
- Coverage   56.13%   56.12%   -0.01%     
==========================================
  Files         279      279              
  Lines       27322    27324       +2     
  Branches     4444     4444              
==========================================
  Hits        15336    15336              
- Misses      11986    11988       +2
Flag Coverage Δ
#unittest 56.12% <5%> (-0.01%) ⬇️
Impacted Files Coverage Δ
app/browser/menu.js 51.79% <0%> (ø) ⬆️
app/browser/api/ledger.js 55.47% <0%> (-0.06%) ⬇️
app/browser/bookmarksExporter.js 80.3% <0%> (ø) ⬆️
app/importer.js 36.97% <0%> (ø) ⬆️
app/browser/reducers/downloadsReducer.js 87.37% <20%> (ø) ⬆️

@darkdh darkdh added this to the 0.21.x (Developer Channel) milestone Jan 27, 2018
@darkdh
Copy link
Member Author

darkdh commented Jan 27, 2018

This PR has API changes. Please do upgrade to muon 5.0 and merge this PR simultaneously, @bsclifton.

bridiver
bridiver previously approved these changes Jan 29, 2018
@darkdh darkdh merged commit 76e7d68 into master Jan 29, 2018
darkdh added a commit that referenced this pull request Jan 29, 2018
New electron dialog changes
@srirambv
Copy link
Collaborator

srirambv commented Feb 1, 2018

@darkdh does this also detect pdf?

@darkdh
Copy link
Member Author

darkdh commented Feb 1, 2018

@srirambv yes.
screen shot 2018-02-01 at 8 22 35 am

@bsclifton
Copy link
Member

So awesome seeing this merged! Great work, @darkdh! 😄

@srirambv
Copy link
Collaborator

@darkdh scenario e fails. Shows All files but doesn't have Torrent
11906-torrent

@srirambv
Copy link
Collaborator

For scenario g, should save as type contain the deb/exe/dmg extension or the file name should contain the extension?
11906-savelink

@srirambv
Copy link
Collaborator

Scenario d also fails on a clean profile. Points to desktop instead of default download path

11906-openfile

@darkdh
Copy link
Member Author

darkdh commented Feb 21, 2018

@srirambv please open issues in milestone 0.21.x for those scenarios and assign them to me. Thanks

darkdh added a commit that referenced this pull request Feb 28, 2018
New electron dialog changes
darkdh added a commit that referenced this pull request Mar 1, 2018
New electron dialog changes
@bsclifton bsclifton modified the milestones: 0.22.x (Developer Channel), 0.21.x w/ Chromium 65 (Beta Channel) Mar 1, 2018
@bsclifton
Copy link
Member

Moving to 0.22.x; we're going to have 0.21.x-C65 only contain the Chromium upgrade 😄 👍

@bsclifton bsclifton modified the milestones: 0.21.x w/ Chromium 65 (Beta Channel), 0.22.x (Developer Channel) Mar 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.