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

Unified Diff: chrome/common/extensions/docs/server2/integration_test.py

Issue 17816005: Doc server broken link detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional information for broken anchor links Created 7 years, 6 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
Index: chrome/common/extensions/docs/server2/integration_test.py
diff --git a/chrome/common/extensions/docs/server2/integration_test.py b/chrome/common/extensions/docs/server2/integration_test.py
index 2ed80f33d1c1558614e6fcf458555314987abba8..35e35c6e2f8fc2c87b1a492be379a85469335111 100755
--- a/chrome/common/extensions/docs/server2/integration_test.py
+++ b/chrome/common/extensions/docs/server2/integration_test.py
@@ -8,7 +8,6 @@
import build_server
build_server.main()
-import logging
import optparse
import os
import sys
@@ -17,6 +16,7 @@ import unittest
from local_renderer import LocalRenderer
from fake_fetchers import ConfigureFakeFetchers
+from find_broken_links import CreateProcessor, FindBrokenLinks
from handler import Handler
from servlet import Request
from test_util import EnableLogging, DisableLogging
@@ -61,6 +61,26 @@ class IntegrationTest(unittest.TestCase):
finally:
print('Took %s seconds' % (time.time() - start_time))
+ print "Checking for broken links..."
+ failures = []
+ def writer(*args):
+ # Print out and keep track of links that failed.
+ for arg in args:
+ print arg,
+ print
+ failures.append(args)
+
+ def renderer(path):
+ return Handler(Request.ForTest(path)).Get()
+
+ start_time = time.time()
+ FindBrokenLinks(
+ CreateProcessor(renderer),
+ ('/extensions/index.html', '/apps/about_apps.html'), writer=writer)
+
+ print 'Finding %d broken links took %s seconds' % (
+ len(failures), time.time() - start_time)
+
public_files = _GetPublicFiles()
print('Rendering %s public files...' % len(public_files.keys()))

Powered by Google App Engine
This is Rietveld 408576698