-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As if they're preferences Persist feedback loop
- Loading branch information
1 parent
c536783
commit 6c5a726
Showing
157 changed files
with
23,599 additions
and
1,944 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash -ex | ||
echo Clone tester repo. | ||
git clone https://github.com/John-LittleBearLabs/ipfs_client_clitester.git | ||
|
||
echo Install dependencies. | ||
sudo apt-get update | ||
sudo apt-get install --yes cmake ninja-build binutils libc6{,-dev} | ||
pip3 install conan | ||
conan profile detect || echo "Profile detection failed. Perhaps the default profile already existed - perhaps this user has already done some conan-based builds." | ||
|
||
echo Build conan library | ||
conan create --build=missing ipfs_chromium/library/ | ||
|
||
echo Configure clitester | ||
mkdir tester_build | ||
cmake \ | ||
-G Ninja \ | ||
-S ipfs_client_clitester \ | ||
-B tester_build \ | ||
-D CMAKE_BUILD_TYPE=Release | ||
|
||
echo Build clitester | ||
cmake --build tester_build --config Release | ||
|
||
echo Start test server | ||
( timeout 3600 python3 ./ipfs_chromium/test_data/test_server.py 8080 2>&1 | tee server.log & ) & | ||
for t in 1{0..9} | ||
do | ||
if grep -n . server.log | ||
then | ||
break | ||
elif curl -m $t 'http://localhost:8080/ping' | ||
then | ||
sleep 1 | ||
else | ||
sleep ${t} | ||
fi | ||
done | ||
|
||
function url_case() { | ||
echo "url_case(" "${@}" ")" | ||
if timeout 360 ./tester_build/clitester warning "${1}://${2}" | ||
then | ||
echo clitester exited with successful status | ||
else | ||
echo "Directly reported error code from clitester run - usually means timeout killed it. " "${@}" | ||
exit 7 | ||
fi | ||
n=`sed 's,[^A-Za-z0-9\.],_,g' <<< ${2}` | ||
if cat "_${1}_${n}" | md5sum | cut -d ' ' -f 1 > actual | ||
then | ||
ls -lrth _ip?s_* | ||
if [ $# -ge 3 ] | ||
then | ||
echo "${3}" > expected | ||
if diff actual expected | ||
then | ||
echo good | ||
else | ||
echo "Got wrong result: " "${@}" | ||
exit 8 | ||
fi | ||
fi | ||
else | ||
grep -n . server.log || sleep 1 | ||
ls -lrth _ip?s_* | ||
echo "Failure: ${*}" | ||
exit 9 | ||
fi | ||
} | ||
url_case ipfs bafkqacdjmrsw45djor4q ff483d1ff591898a9942916050d2ca3f 'Identity (inlined) CID' | ||
url_case ipfs baguqeerah2nswg7r2pvlpbnsz5y4c4pr4wsgbzixdl632w5qxvedqzryf54q 7750fd7b0928f007e1d181763c0dbdb5 'A DAG-JSON document. The block itself md5s to b92348005af4ae4795e6f312844fb359, but the response we are hashing here is an HTML preview page. This does mean this test breaks if you make the preview less ugly.' | ||
url_case ipns en.wikipedia-on-ipfs.org/I/HFE_Too_Slow_1.JPG.webp 09c09b2654e8529740b5a7625e39e0c8 'An image fetched through DNSLink and HAMT sharded directories.' | ||
url_case ipfs bafybeieb33pqideyl5ncd33kho622thym5rqv6sujrmelcuhkjlf2hdpu4/Big%20Buck%20Bunny.webm 06d51286e56badb4455594ebed6daba2 'A large UnixFS file - several hundred blocks.' | ||
url_case ipns k51qzi5uqu5dijv526o4z2z10ejylnel0bfvrtw53itcmsecffo8yf0zb4g9gi/symlinks/relative_link.txt cfe9b69523140b5b5e63874a8e4997e4 'A relative symlink resolves successfully to the file pointed to.' | ||
echo Stop test server. | ||
killall python3 2>/dev/null || true |
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,19 @@ | ||
#!/bin/bash -ex | ||
|
||
echo Install dependencies | ||
sudo apt-get update | ||
sudo apt-get install --yes cmake ninja-build lcov binutils doxygen graphviz libc6{,-dev} valgrind | ||
npm install -g @marp-team/marp-cli | ||
|
||
echo Configure | ||
mkdir build | ||
cmake \ | ||
-G Ninja \ | ||
-S ipfs_chromium \ | ||
-B build \ | ||
-D CMAKE_BUILD_TYPE=Debug | ||
|
||
echo Run Tests | ||
cmake --build build --config Debug --target run_tests | ||
echo Generate Coverage Report | ||
cmake --build build --config Debug --target cov |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
chromium_edits/122.0.6170.3/chrome/browser/ipfs_extra_parts.cc
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,10 @@ | ||
#include "ipfs_extra_parts.h" | ||
|
||
#include "profiles/profile.h" | ||
|
||
#include <components/ipfs/inter_request_state.h> | ||
|
||
void IpfsExtraParts::PostProfileInit(Profile* profile, bool /* is_initial_profile */ ) { | ||
DCHECK(profile); | ||
ipfs::InterRequestState::CreateForBrowserContext(profile, profile->GetPrefs()); | ||
} |
10 changes: 10 additions & 0 deletions
10
chromium_edits/122.0.6170.3/chrome/browser/ipfs_extra_parts.h
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,10 @@ | ||
#ifndef IPFS_EXTRA_PART_H_ | ||
#define IPFS_EXTRA_PART_H_ | ||
|
||
#include <chrome/browser/chrome_browser_main_extra_parts.h> | ||
|
||
class IpfsExtraParts : public ChromeBrowserMainExtraParts { | ||
void PostProfileInit(Profile* profile, bool is_initial_profile) override; | ||
}; | ||
|
||
#endif // IPFS_EXTRA_PART_H_ |
36 changes: 36 additions & 0 deletions
36
chromium_edits/122.0.6170.3/chrome/browser/prefs/browser_prefs.cc.patch
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,36 @@ | ||
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc | ||
index fc9fcf1ff478a..800961b3c8767 100644 | ||
--- a/chrome/browser/prefs/browser_prefs.cc | ||
+++ b/chrome/browser/prefs/browser_prefs.cc | ||
@@ -190,6 +190,7 @@ | ||
#include "printing/buildflags/buildflags.h" | ||
#include "rlz/buildflags/buildflags.h" | ||
#include "third_party/abseil-cpp/absl/types/optional.h" | ||
+#include "third_party/ipfs_client/ipfs_buildflags.h" | ||
|
||
#if BUILDFLAG(ENABLE_BACKGROUND_MODE) | ||
#include "chrome/browser/background/background_mode_manager.h" | ||
@@ -241,6 +242,11 @@ | ||
#include "chrome/browser/pdf/pdf_pref_names.h" | ||
#endif // BUILDFLAG(ENABLE_PDF) | ||
|
||
+#if BUILDFLAG(ENABLE_IPFS) | ||
+#include "components/ipfs/ipfs_features.h" | ||
+#include "components/ipfs/preferences.h" | ||
+#endif | ||
+ | ||
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) | ||
#include "chrome/browser/screen_ai/pref_names.h" | ||
#endif | ||
@@ -1658,6 +1664,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, | ||
IncognitoModePrefs::RegisterProfilePrefs(registry); | ||
invalidation::PerUserTopicSubscriptionManager::RegisterProfilePrefs(registry); | ||
invalidation::InvalidatorRegistrarWithMemory::RegisterProfilePrefs(registry); | ||
+#if BUILDFLAG(ENABLE_IPFS) | ||
+ if (base::FeatureList::IsEnabled(ipfs::kEnableIpfs)) { | ||
+ ipfs::RegisterPreferences(registry); | ||
+ } | ||
+#endif | ||
language::LanguagePrefs::RegisterProfilePrefs(registry); | ||
login_detection::prefs::RegisterProfilePrefs(registry); | ||
lookalikes::RegisterProfilePrefs(registry); |
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
Oops, something went wrong.