run_javascript_tests.py: Be more flexible about directory layout.

The top-level directory name isn't part of the repository, and we
can't count on it always being "pdfium" (though many people will
choose to do it this way).

R=jam@chromium.org

Review URL: https://codereview.chromium.org/921043005
diff --git a/testing/tools/run_javascript_tests.py b/testing/tools/run_javascript_tests.py
index 237321e..4361ea0 100755
--- a/testing/tools/run_javascript_tests.py
+++ b/testing/tools/run_javascript_tests.py
@@ -41,8 +41,9 @@
   my_dir = os.path.dirname(os.path.realpath(__file__))
   testing_dir = os.path.dirname(my_dir)
   pdfium_dir = os.path.dirname(testing_dir)
-  if os.path.basename(pdfium_dir) != 'pdfium':
-    print 'Confused, can not find pdfium directory, aborting.'
+  if (os.path.basename(my_dir) != 'tools' or
+      os.path.basename(testing_dir) != 'testing'):
+    print 'Confused, can not find pdfium root directory, aborting.'
     return 1
 
   # Other scripts are found in the same directory as this one.