| 
    
      
  | 
  
 Chromium Code Reviews
        
  DescriptionAdd check for file:-navigations from PDFs
BUG=654279
TEST=./browser_tests --gtest_filter=PDFExtensionTest.Navigator
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/374249e767a68d8da073a4ed3a4f29236451174c
Cr-Commit-Position: refs/heads/master@{#425287}
   
  Patch Set 1 #
      Total comments: 3
      
     
  
  Patch Set 2 : Put logic at single location, add test #
      Total comments: 2
      
     
  
  
 Messages
    Total messages: 25 (16 generated)
     
  
  
 Description was changed from ========== Add check for file:-navigations from PDFs BUG=654279 TEST=Manually, using steps from bug report. ========== to ========== Add check for file:-navigations from PDFs BUG=654279 TEST=Manually, using steps from bug report. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== 
 The CQ bit was checked by rob@robwu.nl to run a CQ dry run 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 Description was changed from ========== Add check for file:-navigations from PDFs BUG=654279 TEST=Manually, using steps from bug report. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Add check for file:-navigations from PDFs BUG=654279 TEST=Manually, using steps from bug report. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== 
 rob@robwu.nl changed reviewers: + thestig@chromium.org 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: This issue passed the CQ dry run. 
 Lei, I hope you still have energy for this review after a weekend of plumbing ;) 
 thestig@chromium.org changed reviewers: + raymes@chromium.org 
 +raymes for Javascript bits. It turns out plumbing is hard work and I ran out of energy. https://codereview.chromium.org/2402873002/diff/1/chrome/browser/resources/pd... File chrome/browser/resources/pdf/navigator.js (right): https://codereview.chromium.org/2402873002/diff/1/chrome/browser/resources/pd... chrome/browser/resources/pdf/navigator.js:74: if (!this.isSourceFileUrl_ && /^file:/i.test(url)) Can we write a helper function and call it from multiple places? Should navigateInCurrentTab() call it as well? 
 https://codereview.chromium.org/2402873002/diff/1/chrome/browser/resources/pd... File chrome/browser/resources/pdf/navigator.js (right): https://codereview.chromium.org/2402873002/diff/1/chrome/browser/resources/pd... chrome/browser/resources/pdf/navigator.js:74: if (!this.isSourceFileUrl_ && /^file:/i.test(url)) On 2016/10/10 21:07:04, Lei Zhang wrote: > Can we write a helper function and call it from multiple places? Should > navigateInCurrentTab() call it as well? +1 Could you also please add a test to this to navigator_test.js. We may also want a test in pdf_extension_test.cc 
 Description was changed from ========== Add check for file:-navigations from PDFs BUG=654279 TEST=Manually, using steps from bug report. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Add check for file:-navigations from PDFs BUG=654279 TEST=./browser_tests --gtest_filter=PDFExtensionTest.Navigator CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== 
 The CQ bit was checked by rob@robwu.nl to run a CQ dry run 
 https://codereview.chromium.org/2402873002/diff/1/chrome/browser/resources/pd... File chrome/browser/resources/pdf/navigator.js (right): https://codereview.chromium.org/2402873002/diff/1/chrome/browser/resources/pd... chrome/browser/resources/pdf/navigator.js:74: if (!this.isSourceFileUrl_ && /^file:/i.test(url)) On 2016/10/11 06:37:42, raymes wrote: > On 2016/10/10 21:07:04, Lei Zhang wrote: > > Can we write a helper function and call it from multiple places? Should > > navigateInCurrentTab() call it as well? > > +1 > > Could you also please add a test to this to navigator_test.js. We may also want > a test in pdf_extension_test.cc Done. 
 Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) 
 lgtm thanks for the cleanups too https://codereview.chromium.org/2402873002/diff/20001/chrome/test/data/pdf/na... File chrome/test/data/pdf/navigator_test.js (right): https://codereview.chromium.org/2402873002/diff/20001/chrome/test/data/pdf/na... chrome/test/data/pdf/navigator_test.js:53: return; Can we assert navigatorDelegate.navigateInCurrentTabCalled navigatorDelegate.navigateInNewTabCalled navigatorDelegate.navigateInNewWindowCalled are all false in this case? 
 https://codereview.chromium.org/2402873002/diff/20001/chrome/test/data/pdf/na... File chrome/test/data/pdf/navigator_test.js (right): https://codereview.chromium.org/2402873002/diff/20001/chrome/test/data/pdf/na... chrome/test/data/pdf/navigator_test.js:53: return; On 2016/10/13 00:11:34, raymes wrote: > Can we assert > navigatorDelegate.navigateInCurrentTabCalled > navigatorDelegate.navigateInNewTabCalled > navigatorDelegate.navigateInNewWindowCalled > > are all false in this case? That is not needed, because url is undefined iff there is no navigation. That is also why I modified the delegate above to include a default value for url. 
 The CQ bit was checked by rob@robwu.nl 
 CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Description was changed from ========== Add check for file:-navigations from PDFs BUG=654279 TEST=./browser_tests --gtest_filter=PDFExtensionTest.Navigator CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Add check for file:-navigations from PDFs BUG=654279 TEST=./browser_tests --gtest_filter=PDFExtensionTest.Navigator CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Committed patchset #2 (id:20001) 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Description was changed from ========== Add check for file:-navigations from PDFs BUG=654279 TEST=./browser_tests --gtest_filter=PDFExtensionTest.Navigator CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Add check for file:-navigations from PDFs BUG=654279 TEST=./browser_tests --gtest_filter=PDFExtensionTest.Navigator CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/374249e767a68d8da073a4ed3a4f29236451174c Cr-Commit-Position: refs/heads/master@{#425287} ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             
          
        Patchset 2 (id:??) landed as https://crrev.com/374249e767a68d8da073a4ed3a4f29236451174c Cr-Commit-Position: refs/heads/master@{#425287}  | 
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
